Chapter 13: Using Arrays

In one of the recipes in a previous chapter, we mentioned arrays as one of the possible compound data types that bash supports. We said that what bash has is two different data types (strings and numbers), but that there are ways that we can use more than that if we need to. Arrays are just that—something that we need to be able to use since we need something a little bit more complex than single-value variables to solve some problems.

In this chapter, we are going to cover two basic recipes connected to arrays:

  • Basic array manipulation
  • Advanced array manipulation

You can already see that we are being intentionally broad here; arrays are like that—simple on the surface, but with quite a few small tricks if we need ...

Get Linux Command Line and Shell Scripting Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.