From 4e56e59bac0794393886cd1216cc436f067cf336 Mon Sep 17 00:00:00 2001 From: pvincent Date: Tue, 7 Jul 2026 23:51:12 +0400 Subject: [PATCH] quoted args --- bin/bash-strict | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/bash-strict b/bin/bash-strict index 25a29e6..27b2beb 100755 --- a/bin/bash-strict +++ b/bin/bash-strict @@ -30,14 +30,13 @@ function exit { # TODO: take attention to argument like -x or --debug, then shift! command=$1 shift -args=("$@") -args2=() -for i in "${args[@]}"; do args2+=("${i@Q}"); done -# echo "----$command ${args2[@]}------" +original_args=("$@") +quoted_args=() +for i in "${original_args[@]}"; do quoted_args+=("${i@Q}"); done set -TEue -o pipefail export -f exit # echo PROCESS START -bash -c "set -TEue -o pipefail; trap 'exit \$? $TMP_ERROR' ERR TERM INT EXIT; source $command ${args2[*]}" 3>&1 1>&2 2>&3 | tee $TMP_ERROR +bash -c "set -TEue -o pipefail; trap 'exit \$? $TMP_ERROR' ERR TERM INT EXIT; source $command ${quoted_args[*]}" 3>&1 1>&2 2>&3 | tee $TMP_ERROR # echo PROCESS END succesfully