Fix: address shellcheck warnings/errors in example scripts
authorOmair Majid <omajid@redhat.com>
Thu, 11 Oct 2018 18:28:49 +0000 (14:28 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Oct 2018 15:28:10 +0000 (11:28 -0400)
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 <omajid@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/clock-override/run-clock-override
doc/examples/demo/demo-trace
doc/examples/getcpu-override/run-getcpu-override

index 295b48391878005566292ef34a49ad446586e062..3c7f82be7df2eaa33dfb9848c2bbfc74ed24f868 100755 (executable)
@@ -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" "${@}"
index dd677277b7a4c6a248b3d94671bf834e963490c4..000139b8a4ec0d48a05ed9051a69d4929751b99e 100755 (executable)
@@ -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" "${@}"
index d05323349c60f4bf7221c7482ba28ba2eaec16ab..3602c249a19a9426359268e88f3db71919f300d9 100755 (executable)
@@ -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" "${@}"
This page took 0.026188 seconds and 4 git commands to generate.