From 7bc03107629a70f3ec96bf985b45344269438293 Mon Sep 17 00:00:00 2001 From: Ferran Basora Date: Thu, 28 Mar 2019 13:02:15 +0000 Subject: [PATCH] Fix multi regexp --- tmux-thumbs.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tmux-thumbs.sh b/tmux-thumbs.sh index 77b55f9..f066639 100755 --- a/tmux-thumbs.sh +++ b/tmux-thumbs.sh @@ -3,7 +3,7 @@ source ~/.bash_profile function boolean { - VALUE=$(tmux show -v @thumbs-$1 2> /dev/null) + VALUE=$(tmux show -vg @thumbs-$1 2> /dev/null) if [[ "${VALUE}" == "1" ]]; then echo "--$1" @@ -11,7 +11,7 @@ function boolean { } function option { - VALUE=$(tmux show -v @thumbs-$1 2> /dev/null) + VALUE=$(tmux show -vg @thumbs-$1 2> /dev/null) if [[ ${VALUE} ]]; then echo "--$1 ${VALUE}" @@ -21,9 +21,10 @@ function option { function multi { VALUES="" - while read -r VALUE; do + while read -r ITEM_KEY; do + VALUE=$(tmux show -vg $ITEM_KEY 2> /dev/null) VALUES="${VALUES} --$1 ${VALUE}" - done < <(tmux show 2> /dev/null | grep thumbs-$1- | cut -d' ' -f2 | sed s/\"//g) + done < <(tmux show -g 2> /dev/null | grep thumbs-$1- | cut -d' ' -f1) echo ${VALUES} }