Skip to content

Environment variable initialized with setenv are not correctly appended later in modulefile #342

@xdelaruelle

Description

@xdelaruelle

Describe the bug

When defining an environment variable with setenv in a modulefile, if this variable value is later in the modulefile appended (with append Tcl command), initial value set with setenv has disappeared.

To Reproduce

Steps to reproduce the behavior:

With the following mod modulefile:

$ cat mod
#%Module
setenv FOO foo
setenv BAR $env(FOO)
append env(BAR) bar

Load this modulefile then check value of BAR variable:

$ ml -v ./mod
Loading /path/to/mod
$ echo $BAR
bar

Expected behavior

Resulting BAR environment variable should equal to foobar not bar, as it is first initialized with foo value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions