getopt — Parse Command Options

Synopsis

set -- `getopt optstring $*` 

Description

The /usr/bin/getopt command is superseded by the getopts command.

Note

getopt is not supported in the next major release. This release provides a getoptcvt conversion tool. For more information about getopts and getoptcvt, see getopts(1)

Use getopt to break up options in command lines for easy parsing by shell procedures and to check for legal options; you use getopts in shell script loops to ensure standard syntax for command-line options. optstring is a string of recognized option letters; see getopt(3C). If you follow a letter with a colon, the option is expected to have an argument that may or may not be separated from it by white space. Use the special ...

Get Solaris™ 7 Reference 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.