[This is the rewrite of a similar question I asked backwards... Sorry for the confusion!]
I'm confused about leading s and the standard sort
utility. Consider the contents of myfile
:
a
b
a
Executing sort -t : myfile
yields an unexpected result, at least to me:
a
a
b
Does that make sense? <space>
should come either before a-z
(as is the case in ASCII), or after. In the first case I would expect
a
b
a
while in the second case
a
b
a
Why, then, does sort
seem to apply the -b
option (ignore leading s) if when it wasn't included? In fact, to be safe I added the -t
option in order to have exactly one field in each line. (According to the POSIX standard, "A field comprises a maximal sequence of non-separating characters and, in the absence of option -t, any preceding field separator." sort myfile
yields the same output, which is also unexpected.)
Thanks in advance!