linux - Gnu sort: stray characters in field specification -


sort doesn't seem key specification. why?

~/tmp $ sort --version sort (gnu coreutils) 8.25 packaged cygwin (8.25-1) ~/tmp $ echo 'a;b;c;d;e;f;g'|sort --field-separator=';' --key=1,5,2                                           sort: stray character in field spec: invalid field specification '1,5,2' 

from man page:

-k, --key=keydef : sort via key; keydef gives location , type

keydef f[.c][opts][,f[.c][opts]] start , stop position, f field number , c character position in field; both origin 1, , stop position defaults line's end.

since .c , opts part in keydef optional, key specification f,f,f (i.e. field numbers) should correct. did wrong?

btw, environment cygwin, running z-shell.

the 2 fields in -k arg start , end fields. can specify -k number of times, sort on multiple keys. so, -k 1,1 -k 2,2 -k 3,3 sort first on field 1, field 2 field 3.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -