chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
08785e5
)
bin/run-with-shell-env: Preserve the original argument list.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 14 May 2020 13:48:37 +0000
(14:48 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Thu, 14 May 2020 13:48:37 +0000
(14:48 +0100)
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.
bin/run-with-shell-env
patch
|
blob
|
blame
|
history
diff --git
a/bin/run-with-shell-env
b/bin/run-with-shell-env
index ba0afcff046e644d7c59057a285574241666b1c0..00181e3ef943091ad503691d8496df2337f95ce8 100755
(executable)
--- 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
#! /bin/bash -x
exec >/tmp/mdw/hacky.log 2>&1
+declare -a original_args=("$@")
case ${__mdw_profile+t} in
t) ;;
*)
case ${__mdw_profile+t} in
t) ;;
*)
@@
-10,4
+11,4
@@
case ${__mdw_profile+t} in
set -x
;;
esac
set -x
;;
esac
-exec "$
@
"
+exec "$
{original_args[@]}
"