Browse Source

quoted args

main
pvincent 2 weeks ago
parent
commit
4e56e59bac
  1. 9
      bin/bash-strict

9
bin/bash-strict

@ -30,14 +30,13 @@ function exit {
# TODO: take attention to argument like -x or --debug, then shift! # TODO: take attention to argument like -x or --debug, then shift!
command=$1 command=$1
shift 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 set -TEue -o pipefail
export -f exit export -f exit
# echo PROCESS START # 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 # echo PROCESS END succesfully
Loading…
Cancel
Save