I have a tcl script which is a modulefile within the IBM Load Sharing Facitily (lsf) used to configure some environment variables and launch a python script by using the exec
command.
When the module is unloaded normally the opposite of all the commands are run, but also the exec
command is run as normal. I would like it so that the exec
part is only run on module load
and not on module unload
.
Here is what I tried so far
if { !(is-loaded mymodule)} {
exec .venv/bin/python mypython.py
}
I also tried this
if { module-info command load } {
exec .venv/bin/python mypython.py
}
For each one I get a similar error
Module ERROR: invalid bareword "module"
in expression " module-info command [load] ";
should be "$module" or "{module}" or "module(...)" or ...
both exceptions complain either about an invalid bareword (either "is" or "module") depending on which snippet I try. Is my snytax invalid?