From: Mike Frysinger Date: Tue, 3 Apr 2012 15:45:34 +0000 (-0400) Subject: better quoting X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f19b7c424682375728f4fe795036729254b08f68;p=home.git better quoting --- diff --git a/.bin/cros-cbuildbot b/.bin/cros-cbuildbot index 79d5503..25d02d9 100755 --- a/.bin/cros-cbuildbot +++ b/.bin/cros-cbuildbot @@ -1,6 +1,21 @@ #!/bin/bash -vexec() { echo "$@"; exec "$@"; } +vexec() { + local i fmt + for (( i = 1; i <= $#; ++i )) ; do + case ${!i} in + *" "*) fmt="'%s'";; + *) fmt="%s";; + esac + printf "${fmt}" "${!i}" + if [[ $i -lt $# ]] ; then + printf ' ' + else + echo + fi + done + exec "$@" +} cd ~/chromiumos || exit 1