OPTARG

The variable getopts fills with the value of an option that takes one, such as the file name after -f.

In more detail

Read it inside the case branch for that option, because the next call to getopts overwrites it. In silent error mode it holds the offending option letter instead.

Related terms

Taught in

References