关于这个的博客很少
Do you prefer running bash while the rest of the team runs tcsh? Or
perhaps you learned csh and the system administrators only know ksh.
What happens when they (or you) supply an initialization script to
source? If any of these situations sounds familiar, then this may be the
script for you.
env2 takes shell scripts of one flavor in and spits out scripts
effectively equivalent in another dialect. We say "effectively
equivalent" because it does not translate syntax such as if/else
statements. Instead, the original (source) script is evaluated to
determine what environment variables it modifies, and the effective
values of those variables are simply expressed in the syntax of the
destination script's dialect. Typically, this is all you really need for
scripts that modify the environment.
NOTE: If you need to the conditionals and for-loops to be used for
different situations (e.g. different host architectures), then simply
use this script repeatedly as needed.
Future extensions may include aliases or <functions>. Supported
languages currently include: bash, csh, ksh, modulecmd, perl, plist, sh, tclsh, tcsh, vim, yaml, and zsh.
NOTE: The file version is identified by an internally computed SHA1 hash
similar to the way git does versioning. If you get a warning message
about inconsistent hash, it means that somebody modified the file
without updating the $SHA variable.
http://blog.chonor.cn/index.php/environment-module/
https://software.intel.com/en-us/articles/using-environment-modules-with-the-intel-development-tools