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.