From 694562e3b875688af35d9cddb85c2c89658f3c2c Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Fri, 12 Jun 2015 20:57:31 +0100 Subject: [PATCH] getopt: use $(...) command substitution in example script [shellcheck] Reference: https://github.com/koalaman/shellcheck/wiki/SC2006 Signed-off-by: Sami Kerola --- misc-utils/getopt-parse.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc-utils/getopt-parse.bash b/misc-utils/getopt-parse.bash index 29e7f6fa93..aab8c62384 100644 --- a/misc-utils/getopt-parse.bash +++ b/misc-utils/getopt-parse.bash @@ -19,8 +19,8 @@ # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! # We need TEMP as the `eval set --' would nuke the return value of getopt. -TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \ - -n 'example.bash' -- "$@"` +TEMP=$(getopt -o ab:c:: --long a-long,b-long:,c-long:: \ + -n 'example.bash' -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi -- 2.47.2