Debian Codegraph @

testsuite/modulefiles/info/shellsexp

raw
1 #%Module1.0
2
3 ##############################################################################
4 # Modules Revision 3.0
5 # Providing a flexible user environment
6 #
7 # File: info/%M%
8 # Revision: %I%
9 # First Edition: 95/12/06
10 # Last Mod.: %U%, %G%
11 #
12 # Authors: Jens Hamisch, [email protected]
13 #
14 # Description: Testuite modulefile
15 # Command:
16 # Sub-Command: setenv, module-info shell, module-info shelltype
17 #
18 # Invocation: load @M@/@V@
19 # Result: %R{
20 # setenv _LMFILES_ ${_LMFILES_}:@M@/@V@
21 # setenv LOADEDMODULES ${LOADEDMODULES}:@P@/@M@/@V@
22 # setenv testsuite @S@/@ST@
23 # }R%
24 # Comment: %C{
25 # The 'module-info shell' command returns the
26 # user shell as specified as the first argument
27 # to modulecmd.
28 # 'module-info shelltype' returns the name of the
29 # shell defining the syntax of the command output
30 # modulecmd writes.
31 # This modulefile checks the shell and shelltype
32 # probing.
33 # }C%
34 #
35 ##############################################################################
36
37 #
38 # check all known shells in order to set up the return
39 # value.
40 # I know, this isn't very effective, but it's a test!
41 #
42
43 set sh ""
44
45 if { [module-info shell sh] } {
46 set sh "sh"
47 } elseif { [module-info shell ksh] } {
48 set sh "ksh"
49 } elseif { [module-info shell zsh] } {
50 set sh "zsh"
51 } elseif { [module-info shell bash] } {
52 set sh "bash"
53 } elseif { [module-info shell csh] } {
54 set sh "csh"
55 } elseif { [module-info shell tcsh] } {
56 set sh "tcsh"
57 } elseif { [module-info shell fish] } {
58 set sh "fish"
59 } elseif { [module-info shell tcl] } {
60 set sh "tcl"
61 } elseif { [module-info shell cmd] } {
62 set sh "cmd"
63 } elseif { [module-info shell perl] } {
64 set sh "perl"
65 } elseif { [module-info shell python] } {
66 set sh "python"
67 } elseif { [module-info shell ruby] } {
68 set sh "ruby"
69 } elseif { [module-info shell lisp] } {
70 set sh "lisp"
71 } elseif { [module-info shell cmake] } {
72 set sh "cmake"
73 } elseif { [module-info shell r] } {
74 set sh "r"
75 } elseif { [module-info shell pwsh] } {
76 set sh "pwsh"
77 } else {
78 set sh "unknown"
79 }
80
81 #
82 # check all known shell types in order to set up the return
83 # value.
84 #
85
86 set sht ""
87
88 if { [module-info shelltype sh] } {
89 set sht "sh"
90 } elseif { [module-info shelltype csh] } {
91 set sht "csh"
92 } elseif { [module-info shelltype fish] } {
93 set sht "fish"
94 } elseif { [module-info shelltype tcl] } {
95 set sht "tcl"
96 } elseif { [module-info shelltype cmd] } {
97 set sht "cmd"
98 } elseif { [module-info shelltype perl] } {
99 set sht "perl"
100 } elseif { [module-info shelltype python] } {
101 set sht "python"
102 } elseif { [module-info shelltype ruby] } {
103 set sht "ruby"
104 } elseif { [module-info shelltype lisp] } {
105 set sht "lisp"
106 } elseif { [module-info shelltype cmake] } {
107 set sht "cmake"
108 } elseif { [module-info shelltype r] } {
109 set sht "r"
110 } elseif { [module-info shelltype pwsh] } {
111 set sht "pwsh"
112 } else {
113 set sht "unknown"
114 }
115
116 #
117 # This is, what's being returned
118 #
119
120 setenv testsuite "$sh/$sht"
121
122 #
123 # Cleanup
124 #
125
126 unset sh
127 unset sht