diff --git a/tools/regression/bin/sh/builtins/getopts1.0 b/tools/regression/bin/sh/builtins/getopts1.0 new file mode 100644 index 000000000000..ecb509ff9c21 --- /dev/null +++ b/tools/regression/bin/sh/builtins/getopts1.0 @@ -0,0 +1,12 @@ +# $FreeBSD$ +set -- -abc +getopts "ab:" OPTION +echo ${OPTION} + +set -- -ab +getopts "ab:" OPTION +echo ${OPTION} + +shift 1 +getopts "ab:" OPTION +echo ${OPTION} diff --git a/tools/regression/bin/sh/builtins/getopts1.0.stdout b/tools/regression/bin/sh/builtins/getopts1.0.stdout new file mode 100644 index 000000000000..bf8e71e33ef7 --- /dev/null +++ b/tools/regression/bin/sh/builtins/getopts1.0.stdout @@ -0,0 +1,3 @@ +a +a +?