From: Omair Majid Date: Thu, 11 Oct 2018 18:28:49 +0000 (-0400) Subject: Fix: address shellcheck warnings/errors in example scripts X-Git-Tag: v2.12.0-rc1~70 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9f1f640062354364e282f7d18f0e2b0b6eb4a9b7;p=lttng-ust.git 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 --- 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" "${@}"