sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

sort.1 (1912B)


      1 .Dd 2016-02-17
      2 .Dt SORT 1
      3 .Os sbase
      4 .Sh NAME
      5 .Nm sort
      6 .Nd sort lines
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Fl Cbcdfimnru
     10 .Op Fl o Ar outfile
     11 .Op Fl t Ar delim
     12 .Op Fl k Ar key ...
     13 .Op Ar file ...
     14 .Sh DESCRIPTION
     15 .Nm
     16 writes the sorted concatenation of each
     17 .Ar file
     18 to stdout.
     19 If no
     20 .Ar file
     21 is given
     22 .Nm
     23 reads from stdin.
     24 .Sh OPTIONS
     25 .Bl -tag -width Ds
     26 .It Fl C
     27 Check that the concatenation of the given
     28 .Ar files
     29 is sorted rather than sorting them. In this mode, no output is printed to
     30 stdout, and the exit status indicates the result of the check.
     31 .It Fl b
     32 Skip leading whitespace of columns when sorting.
     33 .It Fl c
     34 The same as
     35 .Fl C
     36 except that when disorder is detected, a message is written to stderr
     37 indicating the location of the disorder.
     38 .It Fl d
     39 Skip non-whitespace and non-alphanumeric characters.
     40 .It Fl f
     41 Ignore letter case when sorting.
     42 .It FL i
     43 Skip non-printable characters.
     44 .It Fl k Ar key
     45 Specify a key definition of the form
     46 .Sm off
     47 .Sy S
     48 .No [.
     49 .Sy s
     50 .No ][
     51 .Sy f
     52 .No ][,
     53 .Sy E
     54 .No [.
     55 .Sy e
     56 .No ][
     57 .Sy f
     58 .No ]]
     59 .Sm on
     60 where
     61 .Sy S , s , E
     62 and
     63 .Sy e
     64 are the starting column, starting character in that column, ending column and
     65 the ending character of that column respectively. If they are not specified,
     66 .Sy s
     67 refers to the first character of the specified starting column,
     68 .Sy E
     69 refers to the last column of every line, and
     70 .Sy e
     71 refers to the last character of the ending column.
     72 .Sy f
     73 can be used to specify options
     74 .Sy ( n , b )
     75 that only apply to this key definition.
     76 .Sy b
     77 is special in that it only applies to the column that it was specified after.
     78 .It Fl m
     79 Assume sorted input, merge only.
     80 .It Fl n
     81 Perform a numeric sort.
     82 .It Fl o Ar outfile
     83 Write output to
     84 .Ar outfile
     85 rather than stdout.
     86 .It Fl r
     87 Reverses the sort.
     88 .It Fl t Ar delim
     89 Set
     90 .Ar delim
     91 as the field delimiter.
     92 .It Fl u
     93 Print equal lines only once.
     94 .El
     95 .Sh STANDARDS
     96 The
     97 .Nm
     98 utility is compliant with the
     99 .St -p1003.1-2013
    100 specification.