[plug] word splitting

Ryan ryan at is.as.geeky.as
Wed Nov 17 15:12:43 WST 2004


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
> 




More information about the plug mailing list