summaryrefslogtreecommitdiffhomepage
path: root/shell/ash_test/ash-getopts/getopt_positional.tests
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test/ash-getopts/getopt_positional.tests')
-rwxr-xr-xshell/ash_test/ash-getopts/getopt_positional.tests8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/ash_test/ash-getopts/getopt_positional.tests b/shell/ash_test/ash-getopts/getopt_positional.tests
new file mode 100755
index 000000000..a5404a2a0
--- /dev/null
+++ b/shell/ash_test/ash-getopts/getopt_positional.tests
@@ -0,0 +1,8 @@
+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"