ssoorrtt -- Command

Sort lines of text
ssoorrtt [-bbccddffiimmnnrruu] [-tt _c] [-oo _o_u_t_f_i_l_e] [-TT _d_i_r] [+_b_e_g[-_e_n_d]][_f_i_l_e ...]

ssoorrtt reads lines  from each _f_i_l_e, or from the  standard input if no file is
specified.  It sorts  what it reads, and writes the  sorted material to the
standard output.

ssoorrtt sorts lines by comparing a _k_e_y from each line.  By default, the key is
the entire input line (or _r_e_c_o_r_d) and ordering is in ASCII order.  The key,
however, can  be one or more  _f_i_e_l_d_s within the input  record; by using the
appropriate options, you  can select which fields are used  as the key, and
dictate the character that is used to separate the fields.

The following options  affect how the key is constructed  or how the output
is ordered.

-bb Ignore leading white space (blanks or tabs) in key comparisons.

-dd Dictionary ordering: use only letters, blanks, and digits when comparing
   keys.   This  is   essentially  the  ordering  used  to  sort  telephone
   directories.

-ff Fold upper-case letters to lower case for comparison purposes.

-ii Ignore all  characters outside of the printable  ASCII range (octal 040-
   0176).

-nn The key is a numeric string that consists of optional leading blanks and
   optional minus  sign followed by  any number of digits  with an optional
   decimal point.   Ordering is by  the numeric, as  opposed to alphabetic,
   value of the string.

-rr Reverse the ordering, i.e., ssoorrtt from largest to smallest.

As noted  above, the  key compared  from each line  need not be  the entire
input line.   The option +_b_e_g  indicates the beginning position  of the key
field in the input line, and the optional -_e_n_d indicates that the key field
ends just before the _e_n_d position.  If no -_e_n_d is given, the key field ends
at the end  of the line.  Each of these  positional indicators has the form
+_m._n_f or -_m._n_f,  where _m is the number of  fields to skip in the input line
and _n is the number of  characters to skip after skipping fields.  Optional
flags _f are  chosen from the above key flags  (bbddffiinnrr) and are local to the
specified field.

The following additional options control how ssoorrtt works.

-cc Check the  input to see if  it is sorted.  Print  the first out-of-order
   line found.

-mm Merge the  input files.   ssoorrtt assumes each  _f_i_l_e to be  sorted already.
   With large files, ssoorrtt runs much faster with this option.

-oo _o_u_t_f_i_l_e
   Put the  output into _o_u_t_f_i_l_e  rather than on the  standard output.  This
   allows ssoorrtt  to work correctly  if the output  file is one  of the input
   files.

-tt_c
   Use the  character _c to  separate fields rather than  the default blanks
   and tabs.   For example, -tt/  uses the slash  instead of white  space to
   separate fields;  this is useful  when sorting file  names and directory
   names.

-TT _d_i_r
   Create temporary files in directory _d_i_r rather than the standard place.

-uu Suppress multiple copies of lines with key fields that compare equally.

The following  example sorts the password file  /eettcc/ppaasssswwdd, first by group
number (field 4) and then by user name (field 1):

    sort -t: +3n -4 +0 -1 /etc/passwd

_L_i_m_i_t_s
The COHERENT implementation of ssoorrtt  sets the following limits on input and
output:

     Characters per input record399
     Characters per output record399
     Characters per field     399

_F_i_l_e_s
/uussrr/ttmmpp/ssoorrtt* -- First attempt at temporary files
/ttmmpp/ssoorrtt* -- Second attempt at temporary files

_S_e_e _A_l_s_o
AASSCCIIII, ccoommmmaannddss, ccttyyppee.hh, ttssoorrtt, uunniiqq

_D_i_a_g_n_o_s_t_i_c_s
ssoorrtt returns a nonzero exit status  if internal problems occurred or if the
file was not correctly sorted, in the case of the -cc option.
