getopt – parse command options

commandline session


$getopt hello
 --
$getopt hello how are you ?
 -- how are you 1 c h
$getopt hello hello are you ?
 -- hello are you 1 c h
$getopt hello hello are yours ?
 -- hello are yours 1 c h
$getopt hello hello are yours what ?
 -- hello are yours what 1 c h
$getopt hello hello are yours what
 -- hello are yours what
$getopt hello hello are yours what !
 -- hello are yours what !
$getopt hello hello are yours what $
 -- hello are yours what $

THEORY DROP


getopt is used to break up (parse) options in command lines for
easy parsing by shell procedures, and to check for legal options.