From f19b7c424682375728f4fe795036729254b08f68 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 3 Apr 2012 11:45:34 -0400 Subject: [PATCH] better quoting --- .bin/cros-cbuildbot | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 -- 2.39.5