> for MAGFILE in `ls *.[Zz][Ii][Pp] $MAGDIR/`; do > #lots of other stuff > done
As others noted, the ls command is superfluous and possibly harmful here. One more thing you can do is case-insensitive pathname expansion: shopt -s nocaseglob for MAGFILE in $MAGDIR/*.zip do #lots of other stuff done That will work with bash (begin your script with #!/bin/bash) but not with dash as far as I know. > If I leave out the attempted regular expression of > *.[Zz][Ii][Pp], the loop works but then any other non-zip or > non-ZIP files get processed. Note that that is not a regular expression, it's a shell pattern or glob pattern. They are different, and used in different contexts. Both are immensely useful. Cheers, -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100728172239.ga20...@rimmer.esmertec.com