On Wednesday, October 9, 2013 at 6:09 PM, Eric Blake wrote: > the lack of -k has a locale-independent effect of letting -n > parse as far as possible; then -n has a locale-dependent effect of how > far that actually is
This makes sense. > Without -k to stop things, the -t0 means that '0' serves as > BOTH a separator AND a numeric character - you are sorting on numbers > that span multiple fields. This is counter-intuitive to me, although I now understand the POSIX description and agree that this is what the POSIX description dictates. Also I understand and agree that there's not good enough reason to change it because of cross/back-compatibility. However, I do think that this warrants being called out in the manual or, at least, the info page for sort. Perhaps this is outside of the domain of the current list (but perhaps not?) The POSIX description of sort makes this clear while the current sort documentation in man does not. This is what it currently says in my man: -t, --field-separator=SEP use SEP instead of non-blank to blank transition It should perhaps include : without -k, field-separators will default to being within the key, unless otherwise restricted by locale settings. Or it could just copy the actual description from POSIX, which might be simpler: > -t char > Use char as the field separator character; char shall not be considered to be > part of a field (although it can be included in a sort key). > > > -- gabriel gaster data scientist datascope analytics http://datascopeanalytics.com
