Hello Dave,
> As I'm new to Modules, I'm gratified to see that this list is alive.
Yeah. Mostly with people bitching that modules is seemingly
unsupported :-)
> So here's a question: Has anyone solved the problem of shell
> portability when writing aliases?
I thought so.
> For example, the way one sets the prompt is different in csh-type
> shells and in sh-type shells. So is the quoting behavior. This means
> that I end up saying stuff like this in my modulefiles:
>
> if { [ module-info shelltype ] == "csh" } {
> # csh (and tcsh etc) alias generation
> } else {
> # sh (and ksh and bash etc) alias / function generation
> }
Whats wrong with set-alias? from the man-page (this is
man modulefile):
set-alias alias-name alias-string
Sets an alias or function with the name alias-name
in the user's environment to the string alias-
string. Arguments can be specified using the
Bourne Shell style of function arguments. If the
string contains "$1", then this will become the
first argument when the alias is interpreted by the
shell. The string "$*" corresponds to all of the
arguments given to the alias. The character '$'
may be escaped using the '\' character.
For some shells, aliases are not possible and the
command has no effect. For Bourne shell derelicts,
a shell function will be written (if supported) to
give the impression of an alias. When a modulefile
is unloaded, set-alias becomes unset-alias.
I have admittedly never tried it, but it sounds good, doesn't it?
Sven
--
_ _ Lehrstuhl fuer Mustererkennung und Bildverarbeitung
| |_ __ | |__ Sven Utcke
| | ' \| '_ \ phone: +49 761 203 8274 Am Flughafen 17
|_|_|_|_|_.__/ fax : +49 761 203 8262 79110 Freiburg i. Brsg.
mailto:ut...@in... www.informatik.uni-freiburg.de/~utcke
|