Listmates, I have run into a bash problem with a simple for loop I don't understand and would like input from the gurus to determine if the tldp documentation is in error or if it is me. Safe money says it's me, but here is the situation. I am using example 9.1.2.2. from the following link to construct a simple for loop to extract a directory full of zip files: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_01.html The example give is: [carol@octarine ~/html] cat html2php.sh #!/bin/bash # specific conversion script for my html files to php LIST="$(ls *.html)" for i in "$LIST"; do NEWNAME=$(ls "$i" | sed -e 's/html/php/') cat beginfile > "$NEWNAME" cat "$i" | sed -e '1,25d' | tac | sed -e '1,21d'| tac >> "$NEWNAME" cat endfile >> "$NEWNAME" done So I created the following: #!/bin/bash LIST="$(ls *.zip)" for i in "$LIST"; do unzip $i -d /mnt/nemesis-cfg/home/samba/computer/software/fonts/extract echo "Unzipped: $i to ../extract" done exit 0 It didn't work?? The echo statement showed that $i was receiving the entire $LIST and the loop was only executing once instead of once for each entry in $LIST. Fiddling with it, I got it to work by removing the quotes "" from $LIST in the loop definition like this: #!/bin/bash LIST="$(ls *.zip)" for i in $LIST; do unzip $i -d /mnt/nemesis-cfg/home/samba/computer/software/fonts/extract echo "Unzipped: $i to ../extract" done exit 0 I understand enough to realize the quotes affect bash expansion, but I am curious as to whether the tldp example is in error. What says the brain trust? -- 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@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org