aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-05-06 17:00:10 -0500
committerRob Landley <rob@landley.net>2019-05-06 17:00:10 -0500
commit3b9d89d673547eb0e01e9c4ffcd921ac49afb54d (patch)
treefaf5b1201d0e5542fb0c0ad0d17d0be4a28a70e9 /scripts
parent48162c4ee3fb013c09cecea52c6403a33526f172 (diff)
downloadtoybox-3b9d89d673547eb0e01e9c4ffcd921ac49afb54d.tar.gz
Some "echo" variants default to -e, use printf "%s\n" to avoid that.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/runtest.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/runtest.sh b/scripts/runtest.sh
index 8b992584..6ba1d3f6 100644
--- a/scripts/runtest.sh
+++ b/scripts/runtest.sh
@@ -56,7 +56,7 @@ fi
optional()
{
- option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
+ option=`printf %s "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
# Not set?
if [ -z "$1" ] || [ -z "$OPTIONFLAGS" ] || [ ${#option} -ne 0 ]
then
@@ -89,7 +89,7 @@ wrong_args()
{
if [ $# -ne 5 ]
then
- echo "Test $NAME has the wrong number of arguments ($# $*)" >&2
+ printf "%s\n" "Test $NAME has the wrong number of arguments ($# $*)" >&2
exit
fi
}
@@ -107,7 +107,7 @@ testing()
if [ -n "$SKIP" -o -n "$SKIP_HOST" -a -n "$TEST_HOST" -o -n "$SKIPNEXT" ]
then
- [ ! -z "$VERBOSE" ] && echo "$SHOWSKIP: $NAME"
+ [ ! -z "$VERBOSE" ] && printf "%s\n" "$SHOWSKIP: $NAME"
unset SKIPNEXT
return 0
fi
@@ -125,16 +125,16 @@ testing()
if [ ! -z "$DIFF" ]
then
FAILCOUNT=$[$FAILCOUNT+1]
- echo "$SHOWFAIL: $NAME"
+ printf "%s\n" "$SHOWFAIL: $NAME"
if [ -n "$VERBOSE" ]
then
- [ ! -z "$4" ] && echo "echo -ne \"$4\" > input"
- echo "echo -ne '$5' |$EVAL $2"
- echo "$DIFF"
+ [ ! -z "$4" ] && printf "%s\n" "echo -ne \"$4\" > input"
+ printf "%s\n" "echo -ne '$5' |$EVAL $2"
+ printf "%s\n" "$DIFF"
[ "$VERBOSE" == fail ] && exit 1
fi
else
- echo "$SHOWPASS: $NAME"
+ printf "%s\n" "$SHOWPASS: $NAME"
fi
rm -f input expected actual