Re: Pls help with Unix shell question
From: Michael Heiming (michael+USENET_at_www.heiming.de)
Date: 03/05/04
- Next message: Piestiany7: "Unix script question (basic)"
- Previous message: Chris F.A. Johnson: "Re: Pls help with Unix shell question"
- In reply to: Chris F.A. Johnson: "Re: Pls help with Unix shell question"
- Next in thread: Kenny McCormack: "Re: Pls help with Unix shell question"
- Reply: Kenny McCormack: "Re: Pls help with Unix shell question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 5 Mar 2004 18:56:08 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris F.A. Johnson <c.fa.johnson@rogers.com> wrote:
> On Fri, 05 Mar 2004 at 15:49 GMT, Michael Heiming wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > wl <bli01@yahoo.com> wrote:
> > [..]
> >
> >> I have a bunch of files, ending with ".data" in a Unix directory, which I
> >> want to process in date order with a program. I recall doing
> >> something similar in the old days. Does anyone have an example?
> >
> > for f in `ls -atr *.data`
Hi Chris!
> This breaks is there are spaces in the file names. Use:
> ls -atr *.data | while IFS= read -r f
> Of course, this will not work if there are newlines in any of the
> file names. But I would consider that a broken file system.
Yep, albeit I'd call using spaces in filenames broken, sure most
*nix FS will handle it just fine, albeit it requires lots of
quoting in scripts and isn't IMHO worth the trouble.
- --
Michael Heiming (GPG-Key ID: 0xEDD27B94)
Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of spam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFASL82AkPEju3Se5QRAil/AKCxrrfd1F0GUGZbXE3W2UrBXdpJ4ACgxpAM
lQqRoTqDCPAsWVsu10o4OjM=
=xPR1
-----END PGP SIGNATURE-----
- Next message: Piestiany7: "Unix script question (basic)"
- Previous message: Chris F.A. Johnson: "Re: Pls help with Unix shell question"
- In reply to: Chris F.A. Johnson: "Re: Pls help with Unix shell question"
- Next in thread: Kenny McCormack: "Re: Pls help with Unix shell question"
- Reply: Kenny McCormack: "Re: Pls help with Unix shell question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|