To declare an array in bash
Declare and an array called array and assign three values:
More examples:
To print an array use:
To Iterate Through Array Values
Use for loop syntax as follows:
$i will hold each item in an array. Here is a sample working script:


