Notes
Search…
Basics

Array

Declare an array

We can declare array in bash script using,
1
declare -a prefixArray
Copied!
Now, we can put data on array at any index. Array is 0 indexed.
1
prefixArray[INDEX]=VALUE
2
prefixArray[0]="this is first element"
Copied!
After using array clear the memory using unset,
1
unset prefixArray
Copied!
Last modified 1yr ago
Copy link