From: Sami Kerola Date: Fri, 12 Jun 2015 19:57:31 +0000 (+0100) Subject: getopt: use $(...) command substitution in example script [shellcheck] X-Git-Tag: v2.27-rc1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=694562e3b875688af35d9cddb85c2c89658f3c2c;p=thirdparty%2Futil-linux.git getopt: use $(...) command substitution in example script [shellcheck] Reference: https://github.com/koalaman/shellcheck/wiki/SC2006 Signed-off-by: Sami Kerola --- 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