From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <1cd6434aef47eeafe99955082c22eb55@comcast.net> References: <1cd6434aef47eeafe99955082c22eb55@comcast.net> Date: Sun, 27 Sep 2009 02:02:28 -0700 Message-ID: From: Tharaneedharan Vilwanathan To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [9fans] sort strangeness Topicbox-Message-UUID: 78177f22-ead5-11e9-9d60-3106f5b1d025 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