diff options
author | jilles <jilles@FreeBSD.org> | 2016-04-09 16:06:13 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2016-04-09 16:06:13 +0000 |
commit | 8c8069ff15ec4563a7ca9d91a07748e0fd5a5a67 (patch) | |
tree | bbd1633d34def4e58032ded7110db992a7b7060b | |
parent | 872f9979ca66f9de4958fee179e93aadf7de7dd8 (diff) | |
download | FreeBSD-src-8c8069ff15ec4563a7ca9d91a07748e0fd5a5a67.zip FreeBSD-src-8c8069ff15ec4563a7ca9d91a07748e0fd5a5a67.tar.gz |
sh: Fix some unquoted variables in tests.
The builtins/getopts1.0 test failed if a single-character file existed in
the current directory.
-rw-r--r-- | bin/sh/tests/builtins/getopts1.0 | 8 | ||||
-rw-r--r-- | bin/sh/tests/builtins/getopts2.0 | 2 | ||||
-rw-r--r-- | bin/sh/tests/builtins/getopts9.0 | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/bin/sh/tests/builtins/getopts1.0 b/bin/sh/tests/builtins/getopts1.0 index 64763bc..10d2b59 100644 --- a/bin/sh/tests/builtins/getopts1.0 +++ b/bin/sh/tests/builtins/getopts1.0 @@ -3,7 +3,7 @@ printf -- '-1-\n' set -- -abc getopts "ab:" OPTION -echo ${OPTION} +printf '%s\n' "${OPTION}" # In this case 'getopts' should realize that we have not provided the # required argument for "-b". @@ -14,12 +14,12 @@ echo ${OPTION} printf -- '-2-\n' set -- -ab getopts "ab:" OPTION -echo ${OPTION} +printf '%s\n' "${OPTION}" getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&- -echo ${OPTION} +printf '%s\n' "${OPTION}" # The 'shift' is aimed at causing an error. printf -- '-3-\n' shift 1 getopts "ab:" OPTION -echo ${OPTION} +printf '%s\n' "${OPTION}" diff --git a/bin/sh/tests/builtins/getopts2.0 b/bin/sh/tests/builtins/getopts2.0 index 5a5dbe2..1bd2c32 100644 --- a/bin/sh/tests/builtins/getopts2.0 +++ b/bin/sh/tests/builtins/getopts2.0 @@ -3,4 +3,4 @@ set - -ax getopts ax option set -C getopts ax option -echo $option +printf '%s\n' "$option" diff --git a/bin/sh/tests/builtins/getopts9.0 b/bin/sh/tests/builtins/getopts9.0 index d23fc43..1c35fc6 100644 --- a/bin/sh/tests/builtins/getopts9.0 +++ b/bin/sh/tests/builtins/getopts9.0 @@ -2,8 +2,8 @@ args='-ab' getopts ab opt $args -echo $?:$opt:$OPTARG +printf '%s\n' "$?:$opt:$OPTARG" for dummy in dummy1 dummy2; do getopts ab opt $args - echo $?:$opt:$OPTARG + printf '%s\n' "$?:$opt:$OPTARG" done |