#%Module1.0 ############################################################################## # Modules Revision 3.0 # Providing a flexible user environment # # File: info/%M% # Revision: %I% # First Edition: 95/12/06 # Last Mod.: %U%, %G% # # Authors: Jens Hamisch, Jens.Hamisch@Strawberry.COM # # Description: Testuite modulefile # Command: # Sub-Command: setenv, module-info shell, module-info shelltype # # Invocation: load @M@/@V@ # Result: %R{ # setenv _LMFILES_ ${_LMFILES_}:@M@/@V@ # setenv LOADEDMODULES ${LOADEDMODULES}:@P@/@M@/@V@ # setenv testsuite @S@/@ST@ # }R% # Comment: %C{ # The 'module-info shell' command returns the # user shell as specified as the first argument # to modulecmd. # 'module-info shelltype' returns the name of the # shell defining the syntax of the command output # modulecmd writes. # This modulefile checks the shell and shelltype # probing. # }C% # ############################################################################## # # check all known shells in order to set up the return # value. # I know, this isn't very effective, but it's a test! # set sh "" if { [module-info shell sh] } { set sh "sh" } elseif { [module-info shell ksh] } { set sh "ksh" } elseif { [module-info shell zsh] } { set sh "zsh" } elseif { [module-info shell bash] } { set sh "bash" } elseif { [module-info shell csh] } { set sh "csh" } elseif { [module-info shell tcsh] } { set sh "tcsh" } elseif { [module-info shell fish] } { set sh "fish" } elseif { [module-info shell tcl] } { set sh "tcl" } elseif { [module-info shell cmd] } { set sh "cmd" } elseif { [module-info shell perl] } { set sh "perl" } elseif { [module-info shell python] } { set sh "python" } elseif { [module-info shell ruby] } { set sh "ruby" } elseif { [module-info shell lisp] } { set sh "lisp" } elseif { [module-info shell cmake] } { set sh "cmake" } elseif { [module-info shell r] } { set sh "r" } elseif { [module-info shell pwsh] } { set sh "pwsh" } else { set sh "unknown" } # # check all known shell types in order to set up the return # value. # set sht "" if { [module-info shelltype sh] } { set sht "sh" } elseif { [module-info shelltype csh] } { set sht "csh" } elseif { [module-info shelltype fish] } { set sht "fish" } elseif { [module-info shelltype tcl] } { set sht "tcl" } elseif { [module-info shelltype cmd] } { set sht "cmd" } elseif { [module-info shelltype perl] } { set sht "perl" } elseif { [module-info shelltype python] } { set sht "python" } elseif { [module-info shelltype ruby] } { set sht "ruby" } elseif { [module-info shelltype lisp] } { set sht "lisp" } elseif { [module-info shelltype cmake] } { set sht "cmake" } elseif { [module-info shelltype r] } { set sht "r" } elseif { [module-info shelltype pwsh] } { set sht "pwsh" } else { set sht "unknown" } # # This is, what's being returned # setenv testsuite "$sh/$sht" # # Cleanup # unset sh unset sht