summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-22 07:52:56 +0300
committerLars Wirzenius <liw@liw.fi>2021-05-30 18:21:14 +0300
commit8969ca0ac3403340726cbc314abb999e5fe06f98 (patch)
treec68cf5488a500a9d5ce9f65453d357e3dc624a7f
parentd42b00a6a1d2499d038ae9ddbb1fc5703e1927f9 (diff)
downloadsubplot-8969ca0ac3403340726cbc314abb999e5fe06f98.tar.gz
fix: unset environment variables
The previous code had trouble with environment variables that weren't nice for shell. Using Python avoids this. Not an ideal solution, but I can't be bothered do avoid Python now.
-rw-r--r--share/bash/template/template.sh.tera2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/bash/template/template.sh.tera b/share/bash/template/template.sh.tera
index 5e92371..79e7a15 100644
--- a/share/bash/template/template.sh.tera
+++ b/share/bash/template/template.sh.tera
@@ -124,7 +124,7 @@ scenario_{{ loop.index }}() {
# contains newlines.
envnames()
{
- env -0 | xargs -0 -n1 -i'{}' sh -c "printf '%s\n' '{}' | head -n1 | sed 's/=.*//'"
+ python3 -c 'import os, sys; sys.stdout.write("".join("%s\n" % key for key in os.environ))'
}
# Unset all environment variables. At the beginning of each scenario,