mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
fixed csh init script to deal with funny shell chars like * and {}
This commit is contained in:
35
init/csh.in
35
init/csh.in
@@ -9,23 +9,36 @@ else
|
||||
setenv MODULE_VERSION "@VERSION@"
|
||||
setenv MODULE_VERSION_STACK "@VERSION@"
|
||||
endif
|
||||
set exec_prefix='@BASEPREFIX@$MODULE_VERSION'
|
||||
set exec_prefix='@BASEPREFIX@'
|
||||
|
||||
set prefix=""
|
||||
set postfix=""
|
||||
|
||||
if ( $?histchars ) then
|
||||
set histchar = `echo $histchars | cut -c1`
|
||||
set _histchars = $histchars
|
||||
if ($?prompt) then
|
||||
alias module 'unset histchars;set _prompt="$prompt";eval `'$exec_prefix'/bin/modulecmd '$modules_shell' \!*`;set histchars = $_histchars; set prompt="$_prompt";unset _prompt'
|
||||
else
|
||||
alias module 'unset histchars;eval `'$exec_prefix'/bin/modulecmd '$modules_shell' \!*`;set histchars = $_histchars'
|
||||
endif
|
||||
|
||||
set prefix = 'unset histchars;'
|
||||
set postfix = 'set histchars = $_histchars;'
|
||||
else
|
||||
if ($?prompt) then
|
||||
alias module 'set _prompt="$prompt";set prompt="";eval `'$exec_prefix'/bin/modulecmd '$modules_shell' \!*`;set prompt="$_prompt";unset _prompt'
|
||||
else
|
||||
alias module 'eval `'$exec_prefix'/bin/modulecmd '$modules_shell' \!*`'
|
||||
endif
|
||||
set histchar = \!
|
||||
endif
|
||||
|
||||
if ($?prompt) then
|
||||
set prefix = "$prefix"'set _prompt="$prompt";set prompt="";'
|
||||
set postfix = "$postfix"'set prompt="$_prompt";unset _prompt;'
|
||||
endif
|
||||
|
||||
if ($?noglob) then
|
||||
set prefix = "$prefix""set noglob;"
|
||||
set postfix = "$postfix""unset noglob;"
|
||||
endif
|
||||
|
||||
alias module $prefix'eval `'$exec_prefix'/bin/modulecmd '$modules_shell' '$histchar'*`; '$postfix
|
||||
unset exec_prefix
|
||||
unset prefix
|
||||
unset postfix
|
||||
|
||||
|
||||
setenv MODULESHOME @prefix@
|
||||
|
||||
|
||||
Reference in New Issue
Block a user