Prefers bash
over sh
.
Assuming a bash interactive environment will be correctly formed on login, we should prefer to probe the environment using a shell that reports itself as `bash` instead of `sh` which may not source files that set the environment modules in statements like: ``` case "$is" in bash) test -s /etc/bash.bashrc.local && . /etc/bash.bashrc.local ;; ksh) test -s /etc/ksh.kshrc.local && . /etc/ksh.kshrc.local ;; zsh) test -s /etc/zsh.zshrc.local && . /etc/zsh.zshrc.local ;; ash) test -s /etc/ash.ashrc.local && . /etc/ash.ashrc.local esac test -s /etc/sh.shrc.local && . /etc/sh.shrc.local ```
This commit is contained in:
parent
e864d27641
commit
ae167c09fc
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ def _target_from_clean_env(name):
|
|||
# CAUTION - $USER is generally needed to initialize the environment.
|
||||
# There may be other variables needed for general success.
|
||||
output = env('USER=%s' % os.environ['USER'],
|
||||
'/bin/sh', '--noprofile', '-c',
|
||||
'/bin/bash', '--noprofile', '--norc', '-c',
|
||||
'. /etc/profile; module list -lt',
|
||||
output=str, error=str)
|
||||
default_modules = [i for i in output.splitlines()
|
||||
|
|
Loading…
Reference in a new issue