In this chapter, we'll discuss the different ways of passing arguments to a script, with a special focus on flags. We will start by recapping positional arguments, before continuing with arguments passed as flags. After this, we will talk about how to use flags in your own scripts using the getopts shell builtin.
The following commands will be introduced in this chapter: getopts and shift.
The following topics will be covered in this chapter:
- Positional parameters versus flags
- The getopts shell builtin