Hello Mike,
.version files are Tcl script files that defines ModulesVersion. You
may access environment variable or use modulerc commands in these
scripts.
For instance to change the default version based on machine hostname:
#%Module
switch -- [uname nodename] {
name1 - name2 - name3 {
set ModulesVersion 1
}
default {
set ModulesVersion 2
}
}
If you want to switch over an environment variable, replace "[uname
nodename]" by "[getenv MY_ENV_VAR]".
By the way, I am adding the "lsb" command on next Modules version
(5.5) to be able to easily retrieve current Linux distribution name
and version.
Regards,
Xavier
Le lun. 10 juin 2024 à 20:52, Vanhorn, Mike
<mic...@wr...> a écrit :
>
>
>
> Is there a way to put some sort of code into the .version file so that you can have a different default based on, say, the operating system being used or some other factor?
>
>
>
> We have software, and depending on where the person logs in, the default version might be one of two different versions. That is, one set of workstations needs to run an older version, but some newer ones are able to run a more recent version of the software. So, it would be convenient if the .version file could set ModulesVersion differently based on which workstation the module was being loaded on.
>
>
>
> ---
>
> Mike VanHorn
>
> Senior Computer Systems Administrator
>
> College of Engineering and Computer Science
>
> Wright State University
>
> 265 Russ Engineering Center
>
> 937-775-5157
>
> mic...@wr...
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|