On Fri, May 18, 2012 at 3:58 PM, Clark WANG <[email protected]> wrote:

> 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"?
>

Seems like this issue was introduced in 93u+ 2012-05-04 update.


> $ getopts ':a:bc:' opt --man    <== Note the leading `:' char.
> $ echo $?
> 0    <== This time it exits 0.
> $ getopts ':a:bc:' opt --man


Should reset OPTIND to 1 before this.


>
> $ 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

Reply via email to