Field delimiter in sort program in freebsd
Shayan Pooya
shayan at liveve.org
Sat Jan 25 23:24:11 UTC 2014
I took a look at the source code of sort and saw this condition:
if (sort_opts_vals.field_sep == WEOF) {
errno = EINVAL;
err(2, NULL);
}
https://github.com/freebsd/freebsd/blob/master/usr.bin/sort/sort.c#L1063
Removing this condition and remaking sort fixes the issue (at least I can
use bash to give 0xff to the sort program, no luck with other shells
though).
Using \xff as the record separator makes sense for binary files. Any idea
why there is such a condition in the sort program?
Thanks.
More information about the freebsd-questions
mailing list