| # Test that there is no interference of getopt() |
| # It's unclear what "correct" OPTIND values should be |
| # for "b" and "c" results from "-bc": 2? 3? |
| # What we focus on here is that all options are reported |
| # correct number of times and in correct sequence. |
| while getopts "abc" var -a -bc -abc -def -a; do |
| echo "var:$var" #OPTIND:$OPTIND |
| test $((--loop)) = 0 && break # BUG if this triggers |
| echo "End: var:$var OPTIND:$OPTIND" |
| | sed -e 's/ unrecognized option: / invalid option -- /' \ |
| -e 's/ illegal option -- / invalid option -- /' \ |