New mrb functions are not exported from the environment to the scripts [bash]
Two commands have recently become functions (at least in
When running a bash script in a working area already set up in a bash terminal, the environment variables of the setup (e.g.
MRB_TOP) are propagated to the subshell for the script, but the functions by default are not.
A solution in bash is to mark the functions for exportation:
export -f mrbsetenv mrbslp.
Attached is a test script.
#2 Updated by Lynn Garren almost 7 years ago
- Status changed from Accepted to Assigned
- Assignee set to Lynn Garren
This is a known problem with functions and aliases. The general workaround, which works for all shells, is to setup mrb again inside the child process. You might notice that this is being done for ups so that the setup function/alias can be used. I will make sure all larsoft or mrb scripts which call mrbsetenv or mrbslp use the workaround.