You would think specifying tab as a field separator for sort would work
like this:
cat file | sort -k 3 -t " "
It doesn't:
sort: multi-character tab ` '
So after a little search and some trial and error I got this to work:
cat file | sort -k 3 -t "`/bin/echo -e ' '`"
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 other than echo?
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
03-22-2008, 08:38 PM
Nicholas Robinson
sort with tab field separator
On Saturday 22 March 2008 21:18:11 Amadeus W.M. wrote:
> You would think specifying tab as a field separator for sort would work
> like this:
>
> cat file | sort -k 3 -t " "
>
> It doesn't:
>
> sort: multi-character tab ` '
>
>
> So after a little search and some trial and error I got this to work:
>
> cat file | sort -k 3 -t "`/bin/echo -e ' '`"
>
>
> 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 other than echo?
Take the double quotes out in your first attempt. So command becomes
cat file | sort -k 3 -t
Nick
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list