0

Hello I'm using the project "Environment Modules" in a linux cluster to ease the usage of softs for the users.

Some of my softwares don't only rely on environment variables but as well needs that some files be sourced. How can I source a file from a modulefiles? Or the idea is to "translate" the content of the file to be sourced in a modulefiles?

Thanks

Yann Sagon
  • 547
  • 3
  • 21

2 Answers2

1

Since version 4.6 you've got two possibilities:

  • source-sh: eg. in your modulefile source-sh bash some-script.sh
  • sh-to-mod: for preparing your modulefile: module sh-to-mod some-script.sh > modulefile
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
zs11
  • 159
  • 5
0

According to the FAQ, it's a bad idea because it's not possible to unload the module later.

They recommend to create a modulefile instead:

env | sort > envbefore
. somescript
env | sort > envafter
diff envbefore envafter
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Yann Sagon
  • 547
  • 3
  • 21