busybox/shell/ash_test/ash-getopts/getopt_positional.tests

9 lines
264 B
Plaintext
Raw Permalink Normal View History

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"