From 3cafcc0e684a2a3f58cd6b825f697243fa3dbe21 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 01:11:07 +0100 Subject: [PATCH] fixes --- lgsm/functions/core_getopt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index c651f105d..22adbb52d 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -131,8 +131,8 @@ if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]||[ -z "${getopt}" ]; then # Display available commands index="0" { - for ((index="0"; index <= ${#currentopt[@]}; index+=3)); do - echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |${currentopt[index+2]}" + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t|${currentopt[index+2]}" done } | column -s $'\t' -t else @@ -141,7 +141,7 @@ else for ((index="0"; index < ${#currentopt[@]}; index+=3)); do currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" for ((currcmdindex=1; cmdindex < ${currcmdamount}; currcmdindex++)); do - if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" == "${getopt}" ]; then + if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} break