I have been trying to get a better grasp of some advanced bash concepts, and have been reading through the following reference manual:
I am pretty familiar with C and perl arrays, but have never had a need to use arrays in a bash script. The syntax for a bash array is almost identical to Perl:
This assigns the value 12 to the first slot in the array. Since bash variables are untyped, we can assign a string to the same array:
This assigns the string “my string” to slot two in the array. Useful stuff!