Tech Support > Operating Systems > UNIX / Variants > gnu sort utility does destructive sort?
gnu sort utility does destructive sort?
Posted by Xah on April 19th, 2008


It seems the gnu sort utility does destructive sort?

i.e. if my file is:

b y
b x

and i do “sort -k 1 myFile” then the line got re-ordered?

is there a way to use sort so that if the field is a tie, it leave the
original order as is?

Thanks

Xah
xah@xahlee.org
http://xahlee.org/


Posted by Xah on April 20th, 2008


Got the answer to my own question from help on freenode irc. To do non-
destructive sort with gnu sort, use -s.

http://xahlee.org/UnixResource_dir/unix_tips.html

Xah
xah@xahlee.org
http://xahlee.org/



On Apr 18, 5:10*pm, Xah <xah...@gmail.com> wrote:


Similar Posts