gnu coreutils - sort orders in nonalphabetic order with = followed by a string -


why sort order in different order when = followed string appended line? correct behaviour or bug in version?

$ echo -e "a  = t\nab = t"|sort ab = t  = t $ echo -e "a  = \nab = "|sort  =  ab = $  sort --version sort (gnu coreutils) 8.13 

to me seems happen if there 2 lines 1 starts word substring of first word in other line.

it's locale ignoring spaces. try:

echo -e "a  = t\nab = t" | lc_all=c sort 

or restrict first field

echo -e "a  = t\nab = t" | sort -k1,1 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -