Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jan 2014 08:59:11 -0500
From:      Shayan Pooya <shayan@liveve.org>
To:        freebsd-questions@freebsd.org
Subject:   Field delimiter in sort program in freebsd
Message-ID:  <CABAubTg2RH95LypshV6ZpZP1qQW24TQZfFSSrYs5DzUoqA5tSw@mail.gmail.com>

Next in thread | Raw E-Mail | Index | Archive | Help
Hello,

How can I use the ascii character 0xff as the field delimiter for the
FreeBSD sort program?
On bash on Linux I use the following:
$ sort -t $'\xff' -z
to sort a set of null terminated lines where each field is separated by a
\xff.

The FreeBSD 10 manual page says it has the -t option, but I am not sure how
I should give it the option to use a specific character.

On tcsh:
% sort -t $'\xff'
Illegal variable name.


On bash:
sort -t $'\xfe'
works fine, but:

$ sort -t $'\xff'

complains:

sort: Invalid argument


(Just in case, this is the piece of code that runs on MacOS and Linux but
not on FreeBSD:
https://github.com/discoproject/disco/blob/develop/lib/disco/compat.py#L79because
of this issue).

Thanks.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?CABAubTg2RH95LypshV6ZpZP1qQW24TQZfFSSrYs5DzUoqA5tSw>