emacs-bug-tracker
[Top][All Lists]
Advanced

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

[Emacs-bug-tracker] bug#8394: closed (unexpected behaviour of "sort -n")


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8394: closed (unexpected behaviour of "sort -n")
Date: Thu, 31 Mar 2011 17:19:02 +0000

Your message dated Thu, 31 Mar 2011 19:17:57 +0200
with message-id <address@hidden>
and subject line Re: bug#8394: unexpected behaviour of "sort -n"
has caused the GNU bug report #8394,
regarding unexpected behaviour of "sort -n"
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
8394: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8394
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: unexpected behaviour of "sort -n" Date: Thu, 31 Mar 2011 13:17:07 +0200 User-agent: KMail/1.13.6 (Linux/2.6.38.2; KDE/4.6.1; i686; ; )
I'm wondering about the output b/c Im missing 2 strings :

$> echo "X y z 1 2 3" | xargs -n 1 | sort -n -u
X
1
2
3

-- 
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3



--- End Message ---
--- Begin Message --- Subject: Re: bug#8394: unexpected behaviour of "sort -n" Date: Thu, 31 Mar 2011 19:17:57 +0200
tags 8394 + notabug
thanks

Toralf Förster wrote:
> I'm wondering about the output b/c Im missing 2 strings :
>
> $> echo "X y z 1 2 3" | xargs -n 1 | sort -n -u
> X
> 1
> 2
> 3

That's because you've specified -n (--numeric-sort)
yet gave it non-numeric data.  Each non-numeric
value is mapped to the same "invalid" quantity, and
since three values are "invalid" and you also used -u,
you see only one of them in the output.

For the record, you can reproduce it more simply like this:

    $ printf '%s\n' X y z 1 2 3|sort -n -u
    X
    1
    2
    3

Remove either the -n or the -u and you'll see all values.

I've marked the issue your message created as "closed".

For next time, we prefer that questions be addressed
to address@hidden, since there they don't automatically
cause creation of a "bug report" that we then have to
classify/close.


--- End Message ---

reply via email to

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