From f3c6d9046c03c71b2028c88a9444519299b7b4c2 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 16 Nov 2011 07:17:21 -0500 Subject: [PATCH] usttrace: allow spaces in command-line arguments The usttrace uses $*, which expands arguments without preserving their boundaries. This causes arguments that include spaces to be mangled: [0] "echo" [1] "hello world" becomes: [0] "echo" [1] "hello" [2] "world" Use "$@" instead so that argument boundaries are preserved. Signed-off-by: Stefan Hajnoczi Signed-off-by: Mathieu Desnoyers --- usttrace | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/usttrace b/usttrace index e76dae7..d1a6e5f 100755 --- a/usttrace +++ b/usttrace @@ -85,16 +85,13 @@ if [ -n "$where" ]; then exit 0 fi -# Prepare vars -CMD=$* - # Validate input if [ -z "$HOME" ]; then error "no home specified" fi -if [ -z "$CMD" ]; +if [ -z "$*" ]; then error "no command specified" usage; @@ -196,7 +193,7 @@ fi fi # Execute the command - $CMD 2>&1 + "$@" 2>&1 ) | tee "$OUTDIR/app.log" ## Because of the keepalive mechanism, we're sure that by the time -- 2.34.1