[wellylug] arrays in bash?

Sigurd Magnusson sigurd at silverstripe.com
Tue May 22 13:27:15 NZST 2007


how do iterate of an array in bash?
 
 
 e.g. can someone change this psuedocode into bash... :)
 
 myarray = ("fish", "yuck"),
 ("chocolate", "yum"),
 ("icecream", "yum")
 
 for food in $myarray; do
 echo I think that $food is $myarray[$food]
 done
 
 Sigurd Magnusson
 SilverStripe
 sigurd at silverstripe.com
 +64 4 978 7332 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20070522/57f44848/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 344 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20070522/57f44848/attachment.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 1622 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20070522/57f44848/attachment-0001.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 934 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20070522/57f44848/attachment-0002.gif 


More information about the wellylug mailing list