From: Matthias Maier Date: Sun, 8 Jan 2017 23:10:25 +0000 (-0600) Subject: Bugfix: Quote in a posix compliant manner X-Git-Tag: v8.5.0-rc1~282^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3745%2Fhead;p=dealii.git Bugfix: Quote in a posix compliant manner --- diff --git a/cmake/scripts/run_test.sh b/cmake/scripts/run_test.sh index 72a39a7a81..53c82727f7 100644 --- a/cmake/scripts/run_test.sh +++ b/cmake/scripts/run_test.sh @@ -31,7 +31,14 @@ NUMDIFF_EXECUTABLE="$3" DIFF_EXECUTABLE="$4" COMPARISON_FILE="$5" shift 5 -RUN_COMMAND=( "$@" ) + +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; + done + echo " " +} + +RUN_COMMAND=$(save "$@") # Ensure uniform sorting for pathname expansion export LC_ALL=C @@ -45,7 +52,8 @@ run(){ rm -f output rm -f stdout - "${RUN_COMMAND[@]}" > stdout 2>&1 + eval "set -- ${RUN_COMMAND}" + "$@" > stdout 2>&1 RETURN_VALUE=$? [ -f output ] || mv stdout output