sbase

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

sort.1 (1919B)


      1 .Dd February 17, 2016
      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.
     30 In this mode, no output is printed to stdout, and the exit status
     31 indicates the result of the check.
     32 .It Fl b
     33 Skip leading whitespace of columns when sorting.
     34 .It Fl c
     35 The same as
     36 .Fl C
     37 except that when disorder is detected, a message is written to stderr
     38 indicating the location of the disorder.
     39 .It Fl d
     40 Skip non-whitespace and non-alphanumeric characters.
     41 .It Fl f
     42 Ignore letter case when sorting.
     43 .It Fl i
     44 Skip non-printable characters.
     45 .It Fl k Ar key
     46 Specify a key definition of the form
     47 .Sm off
     48 .Sy S
     49 .No [.
     50 .Sy s
     51 .No ][
     52 .Sy f
     53 .No ][,
     54 .Sy E
     55 .No [.
     56 .Sy e
     57 .No ][
     58 .Sy f
     59 .No ]]
     60 .Sm on
     61 where
     62 .Sy S , s , E
     63 and
     64 .Sy e
     65 are the starting column, starting character in that column, ending column and
     66 the ending character of that column respectively.
     67 If they are not specified,
     68 .Sy s
     69 refers to the first character of the specified starting column,
     70 .Sy E
     71 refers to the last column of every line, and
     72 .Sy e
     73 refers to the last character of the ending column.
     74 .Sy f
     75 can be used to specify options
     76 .Sy ( n , b )
     77 that only apply to this key definition.
     78 .Sy b
     79 is special in that it only applies to the column that it was specified after.
     80 .It Fl m
     81 Assume sorted input, merge only.
     82 .It Fl n
     83 Perform a numeric sort.
     84 .It Fl o Ar outfile
     85 Write output to
     86 .Ar outfile
     87 rather than stdout.
     88 .It Fl r
     89 Reverses the sort.
     90 .It Fl t Ar delim
     91 Set
     92 .Ar delim
     93 as the field delimiter.
     94 .It Fl u
     95 Print equal lines only once.
     96 .El
     97 .Sh STANDARDS
     98 The
     99 .Nm
    100 utility is compliant with the
    101 .St -p1003.1-2013
    102 specification.