nt9856x/BSP/busybox/shell/ash_test/ash-getopts/getopt_positional.tests
2023-03-28 15:07:53 +08:00

9 lines
264 B
Plaintext
Executable File

set -- -q -w -e r -t -y
echo "*** no OPTIND, optstring:'we' args:$*"
var=QWERTY
while getopts "we" var; do
echo "var:'$var' OPTIND:$OPTIND"
done
# unfortunately, "rc:0" is shown since while's overall exitcode is "success"
echo "exited: var:'$var' OPTIND:$OPTIND"