See following example:
$ echo ${.sh.version}
Version JMP 93u+ 2012-05-04
$
$ getopts 'a:bc:' opt --man
Usage: /root/bin/ksh.120504.93u+ [-b] [-a arg] [-c arg] <== This is fine.
$ echo $?
0 <== Should it exit 2 here since "A usage or information message was
generated"?
$ getopts ':a:bc:' opt --man <== Note the leading `:' char.
$ echo $?
0 <== This time it exits 0.
$ getopts ':a:bc:' opt --man
$ echo $?
1 <== Why does it exit 1 here?
$ getopts 'a:bc:' opt --man <== And this does not print out the usage.
$ echo $?
1 <== And it now exits 1.
$
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users