November 2015
Beginner
282 pages
5h 5m
English
Bash provides a feature to declare a list (or array) of variables in a one-dimensional array that can be an indexed array or associative array. The size of an array can be 0 or more.
An indexed array contains variables that may or may not have been initialized continuously. Indices of an indexed array start from 0. This means that the first element of an array will start at an index 0.
An indexed array can be declared by just initializing any index as follows:
array_name[index]=value
Here, an index can be any positive integer or an expression must be evaluated to a positive integer.
Another way of declaring is by using the declare shell built in as follows: ...