]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
getopt: use $(...) command substitution in example script [shellcheck]
authorSami Kerola <kerolasa@iki.fi>
Fri, 12 Jun 2015 19:57:31 +0000 (20:57 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Jun 2015 10:06:12 +0000 (12:06 +0200)
Reference: https://github.com/koalaman/shellcheck/wiki/SC2006
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/getopt-parse.bash

index 29e7f6fa93983fb2c37b9a9adac7d8baa7cc286c..aab8c62384bc6846e8f17e1fc763247154e119b1 100644 (file)
@@ -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