The module(1) command really should have a significant return value, so it can be used in scripts. For instance
when trying to load a non-existant module the command
ModuleCmd_Load.c(200):ERROR:105: Unable to locate a modulefile for 'doesnotexist'
but still returns 0.
How to solve it:
If modulecmd detects an error, it should print
"false" as the last statement to stdout, and since the
output is evaluated by the shell, the return
value will be non-zero.