Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Feb 2008 01:41:46 -0600
David Bolt wrote:
On Fri, 15 Feb 2008, Randall R Schulz wrote:-
On Thursday 14 February 2008 23:13, David C. Rankin wrote:...It's "IFS" not "AFS" and you need the "in" keyword as David Bolt
Stumbling around, it seems if you include AFS='\n' it will keep the
loop from breaking on spaces by specifying that it only break on
newlines and not spaces. So filenames with spaces (all my wife's
digital pictures are) this is the only thing I have found to work
without extensive character and replacing spaces with '_':
mentioned:
And if the script is more than just a quick one-liner, you should really
be saving and restoring the old IFS, or you can end up with some rather
difficult to diagnose failures. You can find an example of this is in
/etc/init.d/alsasound
IFS is what I used, don't know how AFS got in there.
Yes, it was kind of comical when after running the script I had managed to loose the "ls" command. I'm not entirely sure it was the IFS, but I just logged out and logged back on and all was well.
--
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
- References:
- [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- From: David C. Rankin
- Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- From: Anders Johansson
- Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- From: David C. Rankin
- Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- From: Randall R Schulz
- Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- From: David Bolt
- [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- Prev by Date: Re: [opensuse] KDE4
- Next by Date: Re: [opensuse] ext3 check forced = frustration
- Previous by thread: Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- Next by thread: Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?
- Index(es):
Relevant Pages
|