aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfbt <fbt@fleshless.org>2018-07-27 23:49:51 +0300
committerfbt <fbt@fleshless.org>2018-07-27 23:49:51 +0300
commit4d9c5582642a8dc8c1c646d7ec603b50a815556a (patch)
tree9170b919f1ee9d49ce6c85c09f6f21e159bf38c8
parentccad66749cfaa76bd4f908e15e61e9f9a6681395 (diff)
downloadsx-open-4d9c5582642a8dc8c1c646d7ec603b50a815556a.tar.gz
sx-open-4d9c5582642a8dc8c1c646d7ec603b50a815556a.zip
bugfix1.6.0
Signed-off-by: fbt <fbt@fleshless.org>
-rwxr-xr-xsx-open9
1 files 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