It was some what strange to me when I experienced that tab as field separator is not supported (not exactly supported. but didn't make it easy to use) in sort command in bash shell. Probably it depends on sort version. But, some how it didn't work in my machine.
The error that I got when I included tab as field separator is:
sort: multi-character tab '\t'
So, after doing search over the above error,here is one of the solutions that worked for me:
TAB=$(printf "\t")
and then using sort -t "$TAB".
For ex:
sort -t "$TAB" -k2,2 -n entries.txt
Tuesday, November 20, 2007
using tab as field separator while using sort command in bash shell
Subscribe to:
Post Comments (Atom)
1 comment:
Thanks, that worked :)
Post a Comment