xref: /freebsd/bin/sh/tests/builtins/getopts10.0 (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1
2set -- -x arg
3opt=not
4getopts x opt
5r1=$? OPTIND1=$OPTIND opt1=$opt
6: $(: $((OPTIND = 1)))
7getopts x opt
8r2=$? OPTIND2=$OPTIND
9[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] &&
10	[ "$OPTIND2" = 2 ]
11