Complex Containers
Tutorials – Bash Arrays
Discover the data structures that make your shell scripts really powerful.
In the first installment of this tutorial [1], I described the main properties of shell variables, which are the basic data structures of the Bash shell. This time, I am going to show you how to handle more complex containers for your data, which make much harder (and cooler!) things possible: Bash arrays.
Note: Unlike almost anything else in the other installments of this tutorial, most of what you will learn here only works with Bash v4 or later. If you are using any reasonably modern Linux distribution, this should not be a problem. However, just to be sure, check your version by typing
echo $BASH_VERSION
[...]
Buy this article as PDF
(incl. VAT)