Name
getopts
Synopsis
getoptsstring name
[args
]
Process command-line arguments (or args
,
if specified) and check for legal options. getopts is used in shell
script loops and is intended to ensure standard syntax for
command-line options. string
contains the
option letters to be recognized by getopts when running the shell
script. Valid options are processed in turn and stored in the shell
variable name
. If an option letter is
followed by a colon, the option must be followed by one or more
arguments.
Get Mac OS X Panther in a Nutshell, 2nd Edition 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.