From 39ac511a5d6dbc141bb3e1d8b4b4b8922c71b5a4 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Thu, 19 Oct 2017 13:40:35 +0530 Subject: extras/hooks: Fix getopt usage `getopt` does not have an optional argument as '-name'. It should be either '-n' or '--name'(see man getopt(1)). This wrong usage resulted in setting the script name as 'ame' instead of $PROGNAME in most of the hook-scripts. Additionally the following line from DESCRIPTION given for `getopt` shell command expects short options for almost every kind of usage mentioned in SYNOPSIS: . . . If no '-o' or '--options' option is found in the first part, the first parameter of the second part is used as the short options string. . . . Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more clarity on its usage. Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce BUG: 1503983 Signed-off-by: Anoop C S --- extras/hook-scripts/stop/pre/S29CTDB-teardown.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extras/hook-scripts/stop/pre/S29CTDB-teardown.sh') diff --git a/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh b/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh index e9116c8cfdb..1435de626b8 100755 --- a/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh +++ b/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh @@ -12,7 +12,7 @@ VOL= META="all" function parse_args () { - ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@") + ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@") eval set -- "$ARGS" while true; do -- cgit