Hi, I hope you understand my English, I have some problem with the "b" option of sort (Slackware 12.2, kernel 2.6.27.7-smp, Coreutils 6.12).

From the "-k" section of the doc:
a character position of zero in pos2 indicates the field's last
character. If ‘.c’ is omitted from pos1, it defaults to 1 (the beginning
of the field); if omitted from pos2, it defaults to 0 (the end of the
field).

reading this I'd expect #1 and #2 to have the same effect, since I didn't read about any special cases.

From the examples section:
The inheritance works in this case because -k 5b,5b and -k 5b,5 are
equivalent, as the location of a field-end lacking a ‘.c’ character
position is not affected by whether initial blanks are skipped.

But #1 and #3 also differ:

$ sort -k 1b,1b       #1
a   x
a  y
a z
^D
a z
a  y
a   x

$ sort -k 1b,1.0b     #2
a   x
a  y
a z
^D
a   x
a  y
a z

$ sort -k 1b,1        #3
a   x
a  y
a z
^D
a   x
a  y
a z

$ sort -uk 1b,1b      #1u
a   x
a  y
a z
^D
a z
a  y
a   x

$ sort -uk 1b,1.0b    #2u
a   x
a  y
a z
^D
a   x

$ sort -uk 1b,1       #3u
a   x
a  y
a z
^D
a   x

--
Thanks
 DC


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to