getopt_positional.tests 264 B

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