Re: sort -nu treatment of 0 empty lines

2005-01-09 Thread Bob Proulx
Jim Meyering wrote:
  Jim Meyering [EMAIL PROTECTED] wrote:
   A string of zero digits is interpreted as `0'.
 Paul Jarc wrote:
  That sounds to me like it's talking about 00.  Maybe A string
  of no digits?  Or A line that ends or has has nondigit characters
  where the number would be?
 
 Good point.
 Thanks.
 
   by a decimal-point character and zero or more digits.  A string of
   no digits is interpreted as @samp{0}.  The @env{LC_NUMERIC}

That almost sounds like a double negative, and confuses me.
The following reads better to me.

  A string without digits is interpreted as @samp{0}.

Bob


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: sort -nu treatment of 0 empty lines

2005-01-07 Thread Jim Meyering
Ulrich Hermisson [EMAIL PROTECTED] wrote:

 Hello,

 the following behaviour of sort -nu needs not necessarily be considered a
 bug:

 $ echo ,2,0,1,-2,3,-4 | tr , \n | sort -nu
 -4
 -2

 1
 2
 3

Thanks for the report.
POSIX requires sort, with -n or `-kM,Nn', to interpret an empty field as 0.
The documentation (info sort) already says that an empty field is valid
but doesn't specify how it's interpreted.

I've just added a sentence saying that.
Here's the new description:

`--numeric-sort'
 Sort numerically: the number begins each line; specifically, it
 consists of optional blanks, an optional `-' sign, and zero or more
 digits possibly separated by thousands separators, optionally
 followed by a decimal-point character and zero or more digits.  A
 string of zero digits is interpreted as `0'.  The `LC_NUMERIC'
 locale specifies the decimal-point character and thousands
 separator.


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: sort -nu treatment of 0 empty lines

2005-01-07 Thread Jim Meyering
 Jim Meyering [EMAIL PROTECTED] wrote:
  A string of zero digits is interpreted as `0'.

 That sounds to me like it's talking about 00.  Maybe A string
 of no digits?  Or A line that ends or has has nondigit characters
 where the number would be?

Good point.
Thanks.

  by a decimal-point character and zero or more digits.  A string of
  no digits is interpreted as @samp{0}.  The @env{LC_NUMERIC}


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils