-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tim Connors wrote: > Nope. > > #mkdir tmp > #cd tmp > #for i in `seq 1 10000` ; do touch "blah $i" ; done > #for f in `ls *`; do ls -lA "$f"; done > ls: blah: No such file or directory > ls: 1: No such file or directory > ls: blah: No such file or directory > ls: 10: No such file or directory > ls: blah: No such file or directory > ls: 100: No such file or directory > ls: blah: No such file or directory > ls: 1000: No such file or directory > ls: blah: No such file or directory > .... > > Because each space output by the backticks causes the for loop to plop > the next bit into a new loop.
We can use IFS is ls is really needed (for a command line option or whatever) : ___________________________________________________________________________ [EMAIL PROTECTED] touch "1 2 3" 12 13 [EMAIL PROTECTED] for i in *; do ls "$i"; done 12 1 2 3 13 [EMAIL PROTECTED] for i in $(ls *); do ls "$i";done 12 ls: 1: No such file or directory ls: 2: No such file or directory ls: 3: No such file or directory 13 [EMAIL PROTECTED] IFS=$'\n'; for i in $(ls *); do ls "$i";done; unset IFS 12 1 2 3 13 ___________________________________________________________________________ I'm not saying it's better to use ls though. Cheers, theo -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDyw4YSH6NzHMSyhIRAv/IAKCG1lp5IeNeUoPNtsFSXqL804HuWwCeP82l V03I8zU5PD7f+DplzBlXIaY= =jLiO -----END PGP SIGNATURE----- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]