Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2002 04:22:23 +0200
From:      Giorgos Keramidas <keramida@FreeBSD.org>
To:        ann kok <annkok2001@yahoo.com>
Cc:        questions@FreeBSD.org
Subject:   Re: crontab to backup mail in date format
Message-ID:  <20020122022223.GB3900@hades.hell.gr>
In-Reply-To: <20020121204723.40222.qmail@web20103.mail.yahoo.com>
References:  <20020117015810.GB20298@hades.hell.gr> <20020121204723.40222.qmail@web20103.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-01-21 12:47:23, ann kok wrote:
>
> AFTER SED
> [root@mail /backup]# ls  -1 *backmail.tar.gz | sort -r | sed -e 1,3d
> 221428 2002-01-17backmail.tar.gz
> 220500 2002-01-13backmail.tar.gz
> 217924 2001-12-31backmail.tar.gz
> 215380 2002-01-15backmail.tar.gz
> 214400 2002-01-16backmail.tar.gz
> 187880 2002-01-07backmail.tar.gz
>      0 2002-01-20backmail.tar.gz

Your ls is aliased to something:

	hades!charon:[/tmp]% /bin/ls -1
	0/
	mutt-hades-3900-20
	screens/
	ssh-FkZb0108/

The -1 option of ls(1) will only print *one* column of data.
Yours prints the size of the file too, which means you probably have
`ls' aliased to `ls -s'.

The size column in front of the filename makes sort behave in the
strange way you have noticed.  Since sort does not know you need to
sort everything `after the first space'.

Try using /bin/ls as the listing command, which will not be affected
by any aliases you happen to have at the moment.

-- 
Giorgos Keramidas . . . . . . . . . keramida@{ceid.upatras.gr,freebsd.org}
FreeBSD Documentation Project . . . http://www.freebsd.org/docproj/
FreeBSD: The power to serve . . . . http://www.freebsd.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020122022223.GB3900>