Here is a good one for the group. I've found a workaround so waste too
much time on this.

I'm trying to sort a text file using tab as a field separator. sort
allows you to sort by a field with -k. The default field separator is
whitespace, I need tabs. Sort allows you to set the field separator with
-t, however it chokes when you tell it to use "\t". Observe:
 
[tomp at lotsa sort]$ cat tab.txt
1       cherry
2       orange
3       grape
4       apple
5       mango
[tomp at lotsa sort]$ sort -t "\t" -k 2 tab.txt > sorted.txt
sort: multi-character tab `\t'
[tomp at lotsa sort]$ cat sorted.txt

It's an empty file.
I did found a workaround (those are back-ticks not single quotes)

[tomp at lotsa sort]$ TAB=`echo -e "\t"`
[tomp at lotsa sort]$ sort -t "$TAB" -k 2 tab.txt > sorted.txt
[tomp at lotsa sort]$ cat sorted.txt
4       apple
1       cherry
3       grape
5       mango
2       orange

according to google this works as expected in Unix but not in linux.
http://www.mail-archive.com/bug-textutils@gnu.org/msg00833.html

Does anyone know why I can't use "\t" in sort to set a tab? 

-- 
Tom Penney <blots at visi.com>


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list