getopt_positional.tests 310 B

12345678910111213
  1. (
  2. set -- -q -w -e r -t -y
  3. echo "*** no OPTIND, optstring:'we' args:$*"
  4. var=QWERTY
  5. while getopts "we" var; do
  6. echo "var:'$var' OPTIND:$OPTIND"
  7. done
  8. echo "exited: var:'$var' OPTIND:$OPTIND"
  9. ) 2>&1 \
  10. | sed -e 's/ unrecognized option: / invalid option -- /' \
  11. -e 's/ illegal option -- / invalid option -- /' \