On Thu, Dec 08, 2005 at 03:27:52PM +1100, James Gray wrote: > On Thursday 08 December 2005 15:15, Matthew Hannigan wrote: > > On Thu, Dec 08, 2005 at 12:46:16PM +1100, James Gray wrote: > > > Hi All, > > > > > > I've been fiddling with a script and can't quite get it to work. The > > > problem is premature wild-card expansion. > > > > > > FILES="*.upd dat*.zip *.tar sdat*.exe" > > > [ ... ] > > > for PATTERN in $FILES > > > > Quotes around $FILES (i.e. "$FILES") should work, > > but you said you tried that? > > Yeh, then find gets passed something that results in: > find . -name "*.upd dat*.zip *.tar sdat*.exe".... which doesn't have the > desired result.
Uh yeah. Duh me. > John solved it for me by preventing bash from expanding filename globbing by > invoking the shell with "-f". Simple and it works :) Rather than invoke with -f, you can surround the find with set -f and set +f to turn noglob on and off. Matt -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
