sbase

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

sort.1 (1964B)


      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 h
     43 First line is header line; do not sort it.
     44 .It FL i
     45 Skip non-printable characters.
     46 .It Fl k Ar key
     47 Specify a key definition of the form
     48 .Sm off
     49 .Sy S
     50 .No [.
     51 .Sy s
     52 .No ][
     53 .Sy f
     54 .No ][,
     55 .Sy E
     56 .No [.
     57 .Sy e
     58 .No ][
     59 .Sy f
     60 .No ]]
     61 .Sm on
     62 where
     63 .Sy S , s , E
     64 and
     65 .Sy e
     66 are the starting column, starting character in that column, ending column and
     67 the ending character of that column respectively. 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.