开发者

Behaviour of GNU sort command (with non-letter ASCII characters, such as dot or semicolon)

开发者 https://www.devze.com 2023-03-05 06:05 出处:网络
I want the 开发者_如何学JAVAsort command to treat all characters equal. For example, when I do $ echo -e \'TEST.b\\nTESTa\\nTESTc\' | sort

I want the 开发者_如何学JAVAsort command to treat all characters equal.

For example, when I do

$ echo -e 'TEST.b\nTESTa\nTESTc' | sort
TESTa
TEST.b
TESTc

the dot is ignored.

I would like to get TEST.b at the last or first position. However, I cannot find the proper parameter in the manual page.

(my version of sort is from the GNU core utilities).


Force collation to C in order to compare the raw character values.

$ echo -e 'TEST.b\nTESTa\nTESTc' | LC_COLLATE=C sort
TEST.b
TESTa
TESTc
0

精彩评论

暂无评论...
验证码 换一张
取 消