Flashnux

GNU/Linux man pages

Livre :
Expressions régulières,
Syntaxe et mise en oeuvre :

ISBN : 978-2-7460-9712-4
EAN : 9782746097124
(Editions ENI)

Unix

Unix v6

sort(1)



sort, usort sort or merge files [ -abdnr______x ] [ +pos [ pos ] ] . . . [ ] [ name ] . . .

[ ] [ name ] . . . sorts all the named files together and writes the result on the standard output. The name ‘’ means the standard input. The standard input is also used if no input file names are given. Thus may be used as a filter. The default sort key is an entire line. Default ordering is lexicographic in ASCII collating sequence, except that lower-case letters are considered the same as the corresponding upper-case letters. Non-ASCII bytes are ignored. The ordering is affected by the flags one or more of which may appear: a

Do not map lower case letters. b

Leading blanks (spaces and tabs) are not included in fields. d

‘Dictionary’ order: only letters, digits and blanks are significant in ASCII comparisons. n

An initial numeric string, consisting of optional minus sign, digits and optionally included decimal point, is sorted by arithmetic value. r

Reverse the sense of comparisons. tx

Tab character between fields is Selected parts of the line, specified by +pos and pos, may be used as sort keys. has the form where specifies a number of fields to skip, and a number of characters to skip further into the next field. A missing is taken to be 0. +pos denotes the beginning of the key; pos denotes the first position after the key (end of line by default). The ordering rule may be overridden for a particular key by appending one or more of the flags to +pos. When no tab character has been specified, a field consists of nonblanks and any preceding blanks. Under the flag, leading blanks are excluded from a field. When a tab character has been specified, a field is a string ending with a tab character. When keys are specified, later keys are compared only when all earlier ones compare equal. Lines that compare equal are ordered with all bytes significant. These flag arguments are also understood: m

Merge only, the input files are already sorted. o

The next argument is the name of an output file to use instead of the standard output. This file may be the same as one of the inputs, except under the merge flag m. is a somewhat specialized version of which accepts no collating sequence options: order is always plain ASCII. It also strips out the second and following copies of duplicated lines. A flag prevents this stripping. also understands the and options in the same way as /usr/tmp/stm???



sort(1)