From 2dc25226ed7592b0fd6ad7ab29ef0ca3caee2f20 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 23:40:58 +0100 Subject: [PATCH] new opt test --- lgsm/functions/core_getopt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index f87b55a0e..94024ff79 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -118,7 +118,7 @@ for ((index="0"; index <= ${#currentopt[@]}; index+3)); do done ### Check if user command exists or run the command -if [ ! " ${optcommands[@]} " =~ "${getopt}" ]; then +if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 echo "Usage: $0 [option]" @@ -130,7 +130,7 @@ if [ ! " ${optcommands[@]} " =~ "${getopt}" ]; then index="0" { for ((index="0"; index <= ${#currentopt[@]}; index++)); do - echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |"${currentopt[index+2]}" + echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |${currentopt[index+2]}" done } | column -s $'\t' -t else