Negative subscript causes error in bash version 4.1.2(1)-release (x86_64-redhat-linux-gnu). This commit fixes it.
Signed-off-by: Alex Wang <al...@nicira.com> --- utilities/ovs-command-compgen.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-command-compgen.bash b/utilities/ovs-command-compgen.bash index fa3f1e6..b9df527 100755 --- a/utilities/ovs-command-compgen.bash +++ b/utilities/ovs-command-compgen.bash @@ -600,8 +600,8 @@ if [ "$1" = "debug" ]; then # next argument which is not input yet. This hack is for # compromising the fact that bash cannot take unquoted # empty argument. - if [ "${COMP_WORDS[-1]}" = "TAB" ]; then - COMP_WORDS[${#COMP_WORDS[@]}-1]="" + if [ "${COMP_WORDS[$COMP_CWORD]}" = "TAB" ]; then + COMP_WORDS[$COMP_CWORD]="" fi _ovs_command_complete "debug" -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev