From a0548965f8ec47a59b2e298bcc1594a114279676 Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Wed, 29 Jul 2020 11:27:54 -0700 Subject: [PATCH] sh: Fix meaningless unquoted expansion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [[ ${VALUE} ]] means "expand the VALUE variable, splitting on spaces, and pass those words as arguments to [[…]]". So if VALUE was the string '-n blah' then that would expand to '[[ -n blah ]]' which is meaningful but not at all what was intended. Instead it appears this intented to check for a non-empty string. --- tmux-thumbs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux-thumbs.sh b/tmux-thumbs.sh index b6ee475..58b11f8 100755 --- a/tmux-thumbs.sh +++ b/tmux-thumbs.sh @@ -15,7 +15,7 @@ function add-boolean-param { function add-option-param { VALUE=$(tmux show -vg @thumbs-$1 2> /dev/null) - if [[ ${VALUE} ]]; then + if [ -n "${VALUE}" ]; then PARAMS+=("--$1=${VALUE}") fi }