linux (gnu) sort leading blanks
Hey, smart guys, riddle me this:
Input file to the sort command with no arguments is this: <space><space>3 <space>2 1 Output on every version of linux I tried is: 1 <space>2 <space><space>3 But on EVERY SINGLE other operating system I tried (including OS X, AIX, Solaris, Beos, QNX, Windows and Cygwin) the output is the same as the input unless I use the -b argument. That is the behavior I expected. Is linux gnu sort broken? Extensive google can't find an answer. It seems like -b is default behavior on linux. How do I shut off -b ? How do I get linux sort to give me the result I want? The LC_ALL environment variable has no effect. Why on earth the different behavior on linux? Sucks that my scripts would need a special case just for linux. Any ideas? -R |
Hi, welcome to LQ!
Which version of Linux are you using, and what's your locale? Slackware (en_US, C) shows the desired behaviour, it must be something with the locale ... Cheers, Tink |
Quote:
Quote:
|
sort leading blanks
Thanks guys
LC_COLLATE=C gave me what I want but LC_COLLATE=en_US did not. I am using a pre-installed system image of Fedora 7 for colinux. None of the LC_* environment variables were set at all. But my co-workers using the newest RedHat out of the box got the same behaviour.. I'll have to check his env.vars tomorrow. Hmmm... seems like linux default behavior is different than other systems... oh well Thanks |
All times are GMT -5. The time now is 03:39 AM. |