summaryrefslogtreecommitdiff
path: root/bin/pdksh/tests/regress.t
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pdksh/tests/regress.t')
-rw-r--r--bin/pdksh/tests/regress.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/pdksh/tests/regress.t b/bin/pdksh/tests/regress.t
index 95fe97b6b7c..d78a02641de 100644
--- a/bin/pdksh/tests/regress.t
+++ b/bin/pdksh/tests/regress.t
@@ -639,3 +639,27 @@ expected-exit: e != 0
expected-stderr-pattern:
/.*read *only.*/
---
+
+name: regression-43
+description:
+ Can subshells be prefixed by redirections (historical shells allow
+ this)
+stdin:
+ < /dev/null (cat -n)
+---
+
+name: regression-44
+description:
+ getopts sets OPTIND correctly for unparsed option
+stdin:
+ set -- -a -a -x
+ while getopts :a optc; do
+ echo "OPTARG=$OPTARG, OPTIND=$OPTIND, optc=$optc."
+ done
+ echo done
+expected-stdout:
+ OPTARG=, OPTIND=2, optc=a.
+ OPTARG=, OPTIND=3, optc=a.
+ OPTARG=x, OPTIND=3, optc=?.
+ done
+---