Quoting arguments.

This commit is contained in:
Paul Phillips 2011-08-14 10:55:33 -07:00
parent 1b681960f4
commit 0e0dded42f
1 changed files with 12 additions and 1 deletions

13
sbt
View File

@ -111,7 +111,18 @@ done
set -- "${args[@]}"
execRunner () {
(( debug )) && echo "[command line] $@"
# print the arguments one to a line, quoting any containing spaces
(( debug )) && echo "# Executing command line:" && {
for arg; do
if echo "$arg" | grep -q ' '; then
printf "\"%s\"\n" "$arg"
else
printf "%s\n" "$arg"
fi
done
echo ""
}
"$@"
}