Bug #6390

New mrb functions are not exported from the environment to the scripts [bash]

Added by Gianluca Petrillo almost 7 years ago. Updated over 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Two commands have recently become functions (at least in bash): mrbsetenv and mrbslp.
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. (165 Bytes) Test if mrbsetenv can be run in bash scripts Gianluca Petrillo, 05/30/2014 03:41 PM


#1 Updated by Christopher Green almost 7 years ago

  • Status changed from New to Accepted

#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.

#3 Updated by Lynn Garren over 5 years ago

  • Status changed from Assigned to Closed

This will not be done. It is only appropriate for bash, and cannot help users in other environments.

Also available in: Atom PDF