]> git.wh0rd.org Git - home.git/commitdiff
better quoting
authorMike Frysinger <vapier@gentoo.org>
Tue, 3 Apr 2012 15:45:34 +0000 (11:45 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Apr 2012 19:36:46 +0000 (15:36 -0400)
.bin/cros-cbuildbot

index 79d55035e447ea827196e60fac3ddefd3775a6a0..25d02d9b3b613907e3485770c12920ff0f96fe12 100755 (executable)
@@ -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