set-alias command

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 derivatives, 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.

unset-alias alias-name

 
Unsets an alias with the name alias-name in the user's environment. If the shell supports functions then the shell is instructed to unset function alias-name.

system string

 
Pass string to the C library routine system(3). For the system(3) call modulecmd redirects stdout to stderr since stdout would be parsed by the evaluating shell. The exit status of the executed command is returned.
Example
root@centos68:/Modules/modulefiles # cat module-git
#%Module1.0#####################################################################
##
## module-cvs modulefile
##
## modulefiles/module-git.  Generated from module-git.in by configure.
##
proc ModulesHelp { } {
        global version

        puts stderr "\tThis module will set up an alias"
        puts stderr "\tfor easy anonymous check-out of this version of the"
        puts stderr "\tenvironment modules package."
        puts stderr "\get-modules       - retrieve modules sources for this version"
        puts stderr "\n\tVersion $version\n"
}

# for Tcl script use only
set      version                3.2.10
set     _version_               [ string map {. -} $version ]

module-whatis   "get this version of the module sources from SourceForge.net"

set-alias get-modules "git clone git://git.code.sf.net/p/modules/git modules-$_version_ && cd modules-$_version_ && git checkout modules-$_version_"

if [ module-info mode load ] {
        ModulesHelp
}

Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Top articles

Sites

...

Man page of MODULEFILE