[plug] word splitting

gavan at iinet.net.au gavan at iinet.net.au
Wed Nov 17 15:22:58 WST 2004


That doesn't appear to work - doing that makes it specifically look for a file 
named *.jpg.  However, the first example from that page does seem to have 
resolved it - need to set the IFS env variable.  Thanks for that, will check 
out that site some more.
Gavan Blunt

Quoting Ryan <ryan at is.as.geeky.as>:

> I have this bookmarked for this purpose:
> 
> http://www.linuxquestions.org/questions/history/252338
> 
> Ryan
> 
> On Wed, 2004-11-17 at 15:01, gavan at iinet.net.au wrote:
> > I have a question with what I know will be an easy answer, but I can't for
> the 
> > life of me find it anywhere:
> > How do I disable word-splitting in a bash script?
> > Using the following script:
> > 
> > for img in `ls *.jpg`
> > do
> >     echo $img
> > done
> > 
> > it works fine as long as there are no spaces in the filename - if there's a
> 
> > space, $img is broken down into words (eg, if the filename is "file
> name.jpg", 
> > $img on the first iteration is "file" & on the second iteration is
> "name.jpg").
> > 
> > Gavan Blunt.
> > 
> > 
> > _______________________________________________
> > PLUG discussion list: plug at plug.linux.org.au
> > http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> > Committee e-mail: committee at plug.linux.org.au
> > 
> 
> _______________________________________________
> PLUG discussion list: plug at plug.linux.org.au
> http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
> 






More information about the plug mailing list