Unix shell prgrams and AI techniques

Dik T. Winter dik at cwi.nl
Wed Jun 22 21:56:43 AEST 1988


In article <514 at philmds.UUCP> leo at philmds.UUCP (L.J.M. de Wit) writes:
 > B.T.W. Testing this script I discovered what seems to be a bug in sort
 > (Ultrix 2.0).
 > The following two lines when fed into sort -u +15:
 >                 Mon Jun 20 19:36   still logged inuucp      ttyic
 >                 Mon Jun 20 18:07   still logged inleo       ttyid
 > generate only one line:
 >                 Mon Jun 20 19:36   still logged inuucp      ttyic
 > The manual says: A missing -num argument means the end of the line,
 > and for u: Suppress all but one in each set of equal lines. Ignored bytes
 > and bytes outside keys do not participate in the comparision. 
 > Am I wrong or is the manual wrong (or is sort buggy)?
 > 
The output is according the man page for sort on BSD 4.3.  A +pos argument
takes the form +m.n where m denotes a field number and n denotes a character
within a field.  So you ask sorting by the 15th field, there are not so
many fields so all lines are equal, and -u looks at the key only.
-- 
dik t. winter, cwi, amsterdam, nederland
INTERNET   : dik at cwi.nl
BITNET/EARN: dik at mcvax



More information about the Comp.unix.questions mailing list