May 2013
Beginner to intermediate
384 pages
7h 40m
English
Arrays are a very important component for storing a collection of data as separate entities using indexes. Regular arrays can use only integers as their array index. On the other hand, Bash also supports associative arrays that can take a string as their array index. Associative arrays are very useful in many types of manipulations where having a string index makes more sense. In this recipe, we will see how to use both of these.
To use associate arrays, you must have Bash Version 4 or higher.
array_var=(1 2 3 4 5 6) #Values will be stored in consecutive locations starting from index 0.
Alternately, ...
Read now
Unlock full access