cea-hpc / modules

Environment Modules: provides dynamic modification of a user's environment
http://modules.sourceforge.net/
GNU General Public License v2.0
695 stars 109 forks source link

puts command at the start of evaluation changes #432

Closed xdelaruelle closed 2 years ago

xdelaruelle commented 2 years ago

Currently when using puts command to the stdout channel in a modulefile, the passed string is added at the end of the command list to apply to the current shell session.

It seems interesting to be able to put commands also at the start of the command list to apply, for instance to deactivate a setup prior unsetting the PATH to reach the tool that has enabled this setup.

Using a channel named for instance prestdout may help to know the content should be prepended instead of appended:

puts prestdout {mytool deactivate}