scripting

Jason Kircher cdrradar at speakeasy.net
Sun Jul 11 21:40:54 PDT 2004


On Sunday 11 July 2004 23:51, Shane Shields wrote:
> Use single quotes eg.
>
> for i in 'file 1' 'file 2' 'Ian' 'Cheshire Cat' ; do echo $i ; done
>
> The single quotes stop bash from doing its automatic expansion while the
> double quotes allow automatic expansion.
> --
> Shane Shields

I'm one for readability, even if it's a touch lengthy.

for $i in {'file 1', 'James Kirk', 'Spock', 'Leonard McCoy'} ; do
{
    echo $i
} ; done

(I think I got that right...!)
-- 
Anyone sending unwanted advertising e-mail to this address will be charged a 
$25 fee for network traffic and computing time.  By extracting my address 
from this message, its header, or any web site showing my email address 
either in literal or aggregate form, you agree to these terms.




More information about the lfs-chat mailing list