summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-10-02 08:02:44 +0300
committerLars Wirzenius <liw@liw.fi>2020-10-02 12:04:05 +0300
commite2ecc7813c6deb91efd9a1b66a2f9e9ff9721a32 (patch)
treed09ac7aa646aa57d70541571d43705fe5acae0c8 /templates
parent3c9179418efdd8fdd0a7628ee13d4bac63e70eea (diff)
downloadsubplot-e2ecc7813c6deb91efd9a1b66a2f9e9ff9721a32.tar.gz
fix(templates/bash): when unsetting env, handle vars with newlines
Previously we couldn't handle environments with the TERMCAP variable. Now we can. TERMCAP is set, for example, when logging in via ssh to a beefy server to run tests or benchmarks.
Diffstat (limited to 'templates')
-rw-r--r--templates/bash/template.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/bash/template.sh b/templates/bash/template.sh
index 1da4f5b..04af08f 100644
--- a/templates/bash/template.sh
+++ b/templates/bash/template.sh
@@ -236,7 +236,8 @@ scenario_{{ loop.index }}() {
#############################################################################
# Make the environment minimal.
-unset $(env | sed 's/=.*//')
+# unset all environment variables
+unset $(python3 -c 'import os; print("".join(x + "\n" for x in os.environ.keys()))')
export PATH=/bin:/usr/bin
export SHELL=/bin/sh
export HOME=/ # Will be set to datadir for each scenario.