Project

General

Profile

Bug #6390

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

Added by Gianluca Petrillo over 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
-
Start date:
05/30/2014
Due date:
% Done:

0%

Estimated time:
Duration:

Description

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.

test.sh (165 Bytes) test.sh Test if mrbsetenv can be run in bash scripts Gianluca Petrillo, 05/30/2014 03:41 PM

History

#1 Updated by Christopher Green over 6 years ago

  • Status changed from New to Accepted

#2 Updated by Lynn Garren over 6 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 about 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