August 1999
Intermediate to advanced
1000 pages
83h 9m
English
/usr/bin/getopts optstring name [arg...]
getopts optstring name [argument...]
getopts optstring name [arg...]
You can use the getopts command to process command-line arguments and check for legal options. You use the getops command in shell script loops to ensure standard syntax for command-line options.
Each time it is invoked, the getopts command puts the value of the next option in the shell variable specified by the name operand and the index of the next argument to be processed in the shell variable OPTIND. Whenever the shell is invoked, OPTIND is initialized to 1.
When the option requires an option-argument, the getopts command puts it in the shell ...
Read now
Unlock full access