I often have a need to create Linux scripts which contain module load and module unload commands. Is there a way to test if a module is already loaded before executing a module unload command?
The reason why I need to do this is that if I have a module unload command and the module in question is not already loaded, then it will result in error messages. I would like to avoid these error messages by testing for the module being already loaded, and unloading it only if this is the case.
module list.module -V) ?modulecommand does not shoot and error when a not loaded module is unloaded