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

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -