Educating yourself does not mean that you were stupid in the first place; it means that you are intelligent enough to know that there is plenty left to 'learn'. -Melanie Joy

Friday, 11 October 2013

Difference between array[@] and array[*] in shell

October 11, 2013 Posted by Dinesh , , No comments
It is important for quoting and spacing that the ${array[@]}format (rather than ${array[*]}) is used, and also that double quotes are put around the whole construct.  items=(pen "permanent marker" pencil "temporary marker")   for item in ${items[@]} do echo "Item is : $item" done Item is : penItem is : permanentItem is : markerItem is : pencilItem is : temporaryItem is : marker for...