sort with tab field separator

Amadeus W.M. amadeus84 at verizon.net
Sat Mar 22 21:18:11 UTC 2008


You would think specifying tab as a field separator for sort would work 
like this:

cat file | sort -k 3 -t "\t"

It doesn't:

sort: multi-character tab `\\t'


So after a little search and some trial and error I got this to work:

cat file | sort -k 3 -t "`/bin/echo -e '\t'`"


For my own curiosity, can someone please illuminate me as to why the 
first incantation does not work as expected? Is there a more natural way 
to specify \t other than echo?




More information about the fedora-list mailing list