Re: [Nolug] question about sort(1)

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: Mon, 08 Mar 2004 14:54:50 -0600
Message-Id: <1078779290.1765.64.camel@haggis.homelan>

On Mon, 2004-03-08 at 13:18, scotth@scottharney.com wrote:
> Ron Johnson <ron.l.johnson@cox.net> writes:
>
> > Same thing.
> >
> > $ cp download/file.lst .
> > `download/file.lst' -> `./file.lst'
>
> maybe file.lst has some hidden characters which sort(1)
> can be told to ignore...

It better not have hidden characters. file.lst was created
by running a python script and using cut-n-paste and cat between
2 rxvt windows.

> > $ sort file.lst
> > file 14,236 08-25 04:55 ./Analysis of Asteroid Split.pdf
> > file 195,294 01-18 22:09 ./FAQ_Rev05_ENG.pdf
> > file 203,680 05-08 15:56 ./LinuxCompilersCompatibility702.pdf
> > file 30,227 07-26 17:07 ./EasyTables0.8.4-9.tar.bz2
> > file 3,387,062 02-21 16:56 ./24547010.pdf
> > file 493 01-20 18:45 ./MD5SUMS
> > file 50 10-15 19:05 ./GovForum2_2003.ram
> > file 5,454 03-01 12:03 ./HP-LaserJet_1100-hpijs.ppd.gz
> > file 651,283 07-26 14:57 ./Browser282b2.tar.gz
> >
> >> >
> >> > $ uname -a
> >> > Linux haggis 2.6.3 #2 Sun Feb 29 00:58:15 CST 2004 i686 GNU/Linux
> >> >
> >> > $ set |grep LC_
> >> >
> >> > $ cat /etc/locale.gen
> >> > en_US ISO-8859-1
> >> >
> >> >> > Hi,
> >> >> >
> >> >> > I've got this file:
> >> >> >
> >> >> > $ cat download/file.lst
> >> >> > file 3,387,062 02-21 16:56 ./24547010.pdf
> >> >> > file 14,236 08-25 04:55 ./Analysis of Asteroid Split.pdf
> >> >> > file 651,283 07-26 14:57 ./Browser282b2.tar.gz
> >> >> > file 30,227 07-26 17:07 ./EasyTables0.8.4-9.tar.bz2
> >> >> > file 195,294 01-18 22:09 ./FAQ_Rev05_ENG.pdf
> >> >> > file 50 10-15 19:05 ./GovForum2_2003.ram
> >> >> > file 5,454 03-01 12:03 ./HP-LaserJet_1100-hpijs.ppd.gz
> >> >> > file 203,680 05-08 15:56 ./LinuxCompilersCompatibility702.pdf
> >> >> > file 493 01-20 18:45 ./MD5SUMS
> >> >> >
> >> >> > Now when I sort it, it strips away the spaces when doing
> >> >> > the compares:
> >> >> >
> >> >> > $ sort download/file.lst
> >> >> > file 14,236 08-25 04:55 ./Analysis of Asteroid Split.pdf
> >> >> > file 195,294 01-18 22:09 ./FAQ_Rev05_ENG.pdf
> >> >> > file 203,680 05-08 15:56 ./LinuxCompilersCompatibility702.pdf
> >> >> > file 30,227 07-26 17:07 ./EasyTables0.8.4-9.tar.bz2
> >> >> > file 3,387,062 02-21 16:56 ./24547010.pdf
> >> >> > file 493 01-20 18:45 ./MD5SUMS
> >> >> > file 50 10-15 19:05 ./GovForum2_2003.ram
> >> >> > file 5,454 03-01 12:03 ./HP-LaserJet_1100-hpijs.ppd.gz
> >> >> > file 651,283 07-26 14:57 ./Browser282b2.tar.gz
> >> >> >
> >> >> > Obviously, that's wrong. It should be:
> >> >> >
> >> >> > file 50 10-15 19:05 ./GovForum2_2003.ram
> >> >> > file 493 01-20 18:45 ./MD5SUMS
> >> >> > file 5,454 03-01 12:03 ./HP-LaserJet_1100-hpijs.ppd.gz
> >> >> > file 14,236 08-25 04:55 ./Analysis of Asteroid Split.pdf
> >> >> > file 30,227 07-26 17:07 ./EasyTables0.8.4-9.tar.bz2
> >> >> > file 195,294 01-18 22:09 ./FAQ_Rev05_ENG.pdf
> >> >> > file 203,680 05-08 15:56 ./LinuxCompilersCompatibility702.pdf
> >> >> > file 651,283 07-26 14:57 ./Browser282b2.tar.gz
> >> >> > file 3,387,062 02-21 16:56 ./24547010.pdf
> >> >> >
> >> >> > How do I tell sort to do a plain old, dumb ASCII sort?
> >
> > --
> > -----------------------------------------------------------------
> > Ron Johnson, Jr. ron.l.johnson@cox.net
> > Jefferson, LA USA
> >
> > "I'm not a vegetarian because I love animals, I'm a vegetarian
> > because I hate vegetables!"
> > unknown
> >
> > ___________________
> > Nolug mailing list
> > nolug@nolug.org
> >

-- 
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA
"For me and windows it became a matter of easy to start with, and
becoming increasingly difficult to be productive as time went on,
and if something went wrong very difficult to fix, compared to
linux's large over head setting up and learning the system with
ease of use and the increase in productivity becoming larger the
longer I use the system."
Rohan Nicholls , The Netherlands
___________________
Nolug mailing list
nolug@nolug.org
Received on 03/08/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST