Parsing Bash Script Arguments with getopts

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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.47.230