GETOPT (1)

NAME

getopt - parse command options

CONTENTS

Synopsis
Description
See Also
Notes

SYNOPSIS

set -- `getopt optstring $*`

DESCRIPTION

getopt rearranges command options for shell scripts. It accepts an optstring argument like getopt(3), i.e. a list of characters (bytes) where each character represents an option letter. A character followed by : indicates that the option has an argument. When an argument list is passed to getopt, it prints it such that each option forms a separate argument, with option and option argument separated by a space, and a '--' separates options and remaining non-option arguments. For example, 'getopt a:bc -bc -aarg' results in the output '-b -c -a arg --'.

SEE ALSO

sh(1)

NOTES

getopt cannot handle arguments that contain white space. For this reason, the shell special command getopts is preferred over getopt.


Heirloom Toolchest GETOPT (1) 6/24/05
Generated by a modified version of manServer 1.07 from getopt.1 using man macros.