From 4d9c5582642a8dc8c1c646d7ec603b50a815556a Mon Sep 17 00:00:00 2001 From: fbt Date: Fri, 27 Jul 2018 23:49:51 +0300 Subject: [PATCH] bugfix Signed-off-by: fbt --- sx-open | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sx-open b/sx-open index f7a32be..dc11b7a 100755 --- a/sx-open +++ b/sx-open @@ -127,12 +127,13 @@ handle_target() { fi while (( $# )); do - cmd=$1 regex=$2 + cmd_str=$1 regex=$2 + cmd=() - if [[ $cmd == *'%target%'* ]]; then - cmd=( ${cmd//%target%/$target} ) + if [[ $cmd_str == *'%target%'* ]]; then + cmd=( ${cmd_str//%target%/$target} ) else - cmd+=( "$target" ) + cmd=( $cmd_str "$target" ) fi if [[ "$target_left" =~ $regex ]]; then