From ef85ac6076286f47870f7408d4a49b3d13e32468 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Thu, 11 Oct 2018 14:28:49 -0400 Subject: [PATCH] Fix: address shellcheck warnings/errors in example scripts ShellCheck points out a number of warnings in the example scripts. In particular, a number of normal and special shell variables are not quoted correctly. Signed-off-by: Omair Majid Signed-off-by: Mathieu Desnoyers --- doc/examples/clock-override/run-clock-override | 6 +++--- doc/examples/demo/demo-trace | 6 +++--- doc/examples/getcpu-override/run-getcpu-override | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/examples/clock-override/run-clock-override b/doc/examples/clock-override/run-clock-override index 295b4839..3c7f82be 100755 --- a/doc/examples/clock-override/run-clock-override +++ b/doc/examples/clock-override/run-clock-override @@ -2,7 +2,7 @@ # launch with: run-clock-override progname args -DIR=$(dirname $0) -DIR=$(readlink -f $DIR) +DIR=$(dirname "$0") +DIR=$(readlink -f "$DIR") -LTTNG_UST_CLOCK_PLUGIN="$DIR/lttng-ust-clock-override-example.so" ${*} +LTTNG_UST_CLOCK_PLUGIN="$DIR/lttng-ust-clock-override-example.so" "${@}" diff --git a/doc/examples/demo/demo-trace b/doc/examples/demo/demo-trace index dd677277..000139b8 100755 --- a/doc/examples/demo/demo-trace +++ b/doc/examples/demo/demo-trace @@ -1,6 +1,6 @@ #!/bin/sh -DIR=$(dirname $0) -DIR=$(readlink -f $DIR) +DIR=$(dirname "$0") +DIR=$(readlink -f "$DIR") -LD_PRELOAD=$DIR/lttng-ust-provider-ust-tests-demo.so:$DIR/lttng-ust-provider-ust-tests-demo3.so $DIR/demo ${*} +LD_PRELOAD="$DIR/lttng-ust-provider-ust-tests-demo.so:$DIR/lttng-ust-provider-ust-tests-demo3.so" "$DIR/demo" "${@}" diff --git a/doc/examples/getcpu-override/run-getcpu-override b/doc/examples/getcpu-override/run-getcpu-override index d0532334..3602c249 100755 --- a/doc/examples/getcpu-override/run-getcpu-override +++ b/doc/examples/getcpu-override/run-getcpu-override @@ -2,7 +2,7 @@ # launch with: run-getcpu-override progname args -DIR=$(dirname $0) -DIR=$(readlink -f $DIR) +DIR=$(dirname "$0") +DIR=$(readlink -f "$DIR") -LTTNG_UST_GETCPU_PLUGIN="$DIR/lttng-ust-getcpu-override-example.so" ${*} +LTTNG_UST_GETCPU_PLUGIN="$DIR/lttng-ust-getcpu-override-example.so" "${@}" -- 2.34.1