summaryrefslogtreecommitdiff
path: root/tests/getopts10.sub
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2016-05-23 09:57:30 -0400
committerChet Ramey <chet.ramey@case.edu>2016-05-23 09:57:30 -0400
commitbddda3d2e1db0cd378bdf3866dd4eff8e6d78909 (patch)
tree768cb90309fca1fa17b68cf69b05595348cd7e84 /tests/getopts10.sub
parent0fcb33443880575eefb23e03dece81049c4509ea (diff)
downloadbash-bddda3d2e1db0cd378bdf3866dd4eff8e6d78909.tar.gz
commit bash-20160520 snapshot
Diffstat (limited to 'tests/getopts10.sub')
-rw-r--r--tests/getopts10.sub17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/getopts10.sub b/tests/getopts10.sub
new file mode 100644
index 00000000..84bacf8f
--- /dev/null
+++ b/tests/getopts10.sub
@@ -0,0 +1,17 @@
+set -- -a bb
+readonly OPTARG
+getopts :x x
+
+echo OPTARG = $OPTARG x = $x
+
+getopts x x
+echo ${OPTARG-unset} x = $x
+
+typeset -r RO=foo
+typeset -n OPTARG=RO
+
+getopts :x x
+typeset -p RO
+
+getopts x x
+typeset -p RO