From owner-freebsd-questions Mon Jan 21 18:22:33 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id E950D37B402 for ; Mon, 21 Jan 2002 18:22:29 -0800 (PST) Received: from hades.hell.gr (patr530-b165.otenet.gr [212.205.244.173]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id g0M2MP415971; Tue, 22 Jan 2002 04:22:27 +0200 (EET) Received: by hades.hell.gr (Postfix, from userid 1001) id 41AC434; Tue, 22 Jan 2002 04:22:24 +0200 (EET) Date: Tue, 22 Jan 2002 04:22:23 +0200 From: Giorgos Keramidas To: ann kok Cc: questions@FreeBSD.org Subject: Re: crontab to backup mail in date format Message-ID: <20020122022223.GB3900@hades.hell.gr> References: <20020117015810.GB20298@hades.hell.gr> <20020121204723.40222.qmail@web20103.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020121204723.40222.qmail@web20103.mail.yahoo.com> User-Agent: Mutt/1.3.25i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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