PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : sort -n -t: +2 -3


Dr.Doom
2003-09-29, 21:05:20
Howdy,
was bewirken die Parameter +2 und -3 in der Anweisung:
'sort -n -t: +2 -3 datei' ?

'sort -t: -k1 datei' verstehe ich (Sortierung nach dem Inhalt der ersten Spalte).

Tom Servo
2003-09-29, 22:49:53
http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?sort+1
(In der aktuellen Man-Page stehts nicht)


+pos1, -pos2
This is an obsolescent form of -k. pos1 corresponds to field_start,
pos2 corresponds to field_end, except that both fields and
characters are numbered from zero instead of one. The optional type
modifiers are the same as in -k option.



In der aktuellen GNU-Info Datei:


On older systems, `sort' supports an obsolete origin-zero syntax
`+POS1 [-POS2]' for specifying sort keys. POSIX 1003.1-2001 (*note
Standards conformance::) does not allow this; use `-k' instead.