Shell script arrays
Remove the spaces:
array[$i]='sg'
Also, you should access the elements as*:
echo ${array[0]}
See e.g. http://tldp.org/LDP/abs/html/arrays.html.
* Thanks to @Mat for reminding me of this!
Remove the spaces:
array[$i]='sg'
Also, you should access the elements as*:
echo ${array[0]}
See e.g. http://tldp.org/LDP/abs/html/arrays.html.