From: Mark Wooding Date: Thu, 14 May 2020 13:48:37 +0000 (+0100) Subject: bin/run-with-shell-env: Preserve the original argument list. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/731d391f94c8c8fd5f4f79199d644380b430e769 bin/run-with-shell-env: Preserve the original argument list. The `profile' script makes use of `set', which trashes the argument list. Capture it in a shell array at the start (because we're using Bash here) and then run the target program from the array. --- diff --git a/bin/run-with-shell-env b/bin/run-with-shell-env index ba0afcf..00181e3 100755 --- a/bin/run-with-shell-env +++ b/bin/run-with-shell-env @@ -1,5 +1,6 @@ #! /bin/bash -x exec >/tmp/mdw/hacky.log 2>&1 +declare -a original_args=("$@") case ${__mdw_profile+t} in t) ;; *) @@ -10,4 +11,4 @@ case ${__mdw_profile+t} in set -x ;; esac -exec "$@" +exec "${original_args[@]}"