On Wednesday 28 July 2010 13:05:22 Karl Vogel wrote: > >> On 28.07.2010 14:42, Jochen Schulz wrote: > J> I think you meant to write > J> for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]` > J> Another hint: you don't need 'ls' for your case at all. > > I'd recommend keeping the "ls".
Then, you would be wrong. Doing the splitting on the output of ls causes IFS characters in file names to be handled incorrectly: b...@dellbuntu:/tmp% touch 'file with spaces' b...@dellbuntu:/tmp% for f in `ls -d *`; do echo file; done | wc -l 9 b...@dellbuntu:/tmp% for f in *; do echo file; done | wc -l 7 -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/
signature.asc
Description: This is a digitally signed message part.