9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Tharaneedharan Vilwanathan <vdharani@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] sort strangeness
Date: Sun, 27 Sep 2009 02:02:28 -0700	[thread overview]
Message-ID: <dac0a5820909270202jfeea78eo820b2d6483ee3391@mail.gmail.com> (raw)
In-Reply-To: <1cd6434aef47eeafe99955082c22eb55@comcast.net>

hi,

doesnt it seem to be fine?

> Just noticed this
>
> cpu% cat tmp/sorttest
> 2
> 7
> 2.1
> 2.1.4
> 2.1.1
> cpu% sort tmp/sorttest
> 2
> 2.1
> 2.1.1
> 2.1.4
> 7
------> sorts the string values
> cpu% sort -u tmp/sorttest
> 2
> 2.1
> 2.1.1
> 2.1.4
> 7
------> sorts the string values and removes any duplicates (none here)
> cpu% sort -n tmp/sorttest
> 2
> 2.1
> 2.1.4
> 2.1.1
> 7
-----> sorts the numeric values (which is an integer or floating-point
value of format x.y)
In this case 2.1.4 is treated as 2.1 (ignores second "." and following
characters)

> cpu% sort -n -u tmp/sorttest
> 2
> 2.1
> 7
----> sorts the numeric values (which is an integer or floating-point
value of format x.y)
and removes any duplicates. In this case, 2.1, 2.1.4 and 2.1.1 are all
2.1, so removes
duplicates.

or, am i missing something?

thanks
dharani



  reply	other threads:[~2009-09-27  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-27  7:54 Gregory Pavelcak
2009-09-27  9:02 ` Tharaneedharan Vilwanathan [this message]
2009-09-27 13:42   ` Gregory Pavelcak
2009-09-27  9:10 ` Richard Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dac0a5820909270202jfeea78eo820b2d6483ee3391@mail.gmail.com \
    --to=vdharani@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).