Closed twhitehead closed 8 years ago
In the particular setup I'm working on, there is a bash exported function module which is tripping up the environment setup code
module
module () { eval `/usr/bin/modulecmd bash $*` } declare -fx module
It produces the following environment variable definition under printenv
printenv
BASH_FUNC_module()=() { eval `/usr/bin/modulecmd bash $*` }
Which gets translated into the nix-sandbox-rc-... file command
export BASH_FUNC_module()=\(\)\ \{\ \ eval\ \`/usr/bin/modulecmd\ bash\ \$\*\`' '\}
Causing the shell to choke with the error message
/tmp/nix-sandbox-rc-26417EZN line 97 syntax error near unexpected token `('
One solution may be to have nix-create-sandbox-rc just capture and use the output of
nix-create-sandbox-rc
declare -x declare -fx
for the shell script instead of using printenv -0.
printenv -0
Cheers! -Tyson
In the particular setup I'm working on, there is a bash exported function
module
which is tripping up the environment setup codeIt produces the following environment variable definition under
printenv
Which gets translated into the nix-sandbox-rc-... file command
Causing the shell to choke with the error message
One solution may be to have
nix-create-sandbox-rc
just capture and use the output offor the shell script instead of using
printenv -0
.Cheers! -Tyson