Barriere, Francois <fra...@at...> écrit :
> Le 15/12/2014 13:44, Eric Deveaud a écrit :
> > I pushed to git some modifications on the set/unset alias//function depending on the shell mode
> >
> > can you check it and let me know if the behaviour you've experienced is resolved.
>
> I compiled the latest on "master", is it the right version?
yep
> The problem is partially resolved. There is no more error, but in the
> not-interactive case, I see cases (no parameter to the alias) where
> the set and unset functions generate different results.
yes if _alias_ takes an argument then it's a function, an so it is treated accordingly
>
> I have used the follosing simple module for my tests:
>
> -----------------------------------------------------------------------------------
> #%Module1.0
>
> set-alias toto "ls -l"
> set-alias titi "ls -l $*"
> -----------------------------------------------------------------------------------
>
> When loaded/unloaded in non-interactive mode (through the LSF
> scheduler, on a remote machine), it generates the following results
> (the output of modulecmd, not eval'ed):
>
> ******************************************************
> LOADEDMODULES=module/use.own:mytestmod ;export LOADEDMODULES;_LMFILES_=/eng/ref/sw/atmel/modulefiles/latest/modulefiles/misc/module/use.own:/home/fbarriere/privatemodules/mytestmod ;export _LMFILES_;alias toto='ls -l';titi() { ls -l ${1+"$@"};};
> ******************************************************
> LOADEDMODULES=module/use.own ;export LOADEDMODULES;_LMFILES_=/eng/ref/sw/atmel/modulefiles/latest/modulefiles/misc/module/use.own ;export _LMFILES_;unset -f toto;unset -f titi;
> ******************************************************
>
> The first alias, without params is defined as an alias, but undefined as
> a functions.
definitively something wrong in the code modification I've performed.
toto should be "unaliased" not "unset -f"
thanks for your feedback.
Eric
|