Field delimiter in sort program in freebsd

Polytropon freebsd at edvax.de
Sat Jan 25 22:10:37 UTC 2014


On Sat, 25 Jan 2014 09:51:39 -0500, Shayan Pooya wrote:
> Thanks. That explains the error message.  What is the correct way of doing
> it in tcsh though?

I know it's probably one of the most overcomplicated and stupid
approaches, but it seems to work:

	% sort -t `awk 'BEGIN { printf("%c", 0); }'` <in-data>

Please note that I've not tested this. The null byte has a
special meaning, it's interpreted as "end of string" in C-style
strings ("null terminated strings"), so having to use it as a
field delimiter looks a bit strange.

Maybe you could use a search and replace step _prior_ to sorting
to get this resolved? Just a suggestion...



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list