bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort -nu: bug or feature?


From: Andrew Noymer
Subject: Re: sort -nu: bug or feature?
Date: Wed, 8 Sep 2004 08:49:31 -0700 (PDT)

> sort -n takes the selected fields (the whole line if no -k is used) and
> tries to parse a number out of each starting from the beginning of the
> field, ignoring leading whitespace and discarding trailing garbage.  The
> resulting numbers are the sort keys,

Correct.

>which also decide which lines are equivalent for -u.

My original query points out that -n uses the whole line (if no -k) but
-nu does NOT.

$cat > foo
1 1
1 0

$sort -n foo
1 0
1 1

$sort -nu foo
1 1

Andrew




reply via email to

[Prev in Thread] Current Thread [Next in Thread]