From 0e0dded42fa2c1350bb93a6bee78648fe0bef2b9 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 14 Aug 2011 10:55:33 -0700 Subject: [PATCH] Quoting arguments. --- sbt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sbt b/sbt index 12851eb56..cf4152220 100755 --- a/sbt +++ b/sbt @@ -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 "" + } + "$@" }