From 1659c7277f271bb21e91abf123e983897ffca985 Mon Sep 17 00:00:00 2001 From: lakata Date: Wed, 24 Apr 2002 01:15:46 +0000 Subject: [PATCH] fixed csh init script to deal with funny shell chars like * and {} --- init/csh.in | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/init/csh.in b/init/csh.in index c48615de..49b9496b 100644 --- a/init/csh.in +++ b/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@