Re: umask in modules
Manage your shell environment variables and aliases
Brought to you by:
leomania,
xdelaruelle
From: R.K. O. Ph.D. <rk...@ow...> - 2000-05-30 20:39:27
|
> From own...@en... Tue May 30 10:40:52 2000 > To: Tor Asle Foss <Tor...@er...> > Cc: mod...@en... > Subject: Re: umask in modules > From: Istvan Marko <mi...@im...> > Lines: 19 > Sender: own...@en... > > Tor Asle Foss <Tor...@er...> writes: > > > Hi, can anyone tell me if it is possible to use the umask command in a startup > > module to get this new umask available for all the shells I start up. > > I don't think Modules supports this. Looking at the sources and the > documentation, Modules can handle the following resources: > > - Environment variables > - aliases (where supported) > - X resources > > Adding the following could be useful: > - umask > - X font paths > anything else? > > -- > Istvan > If you really want to set a umask, it is already possible within modules. In this case you want to communicate directly with the shell, that can be done by outputting to stdout. Remember, that "module" is just an alias that eval's the output of the modulecmd program. create a module with ... if [ module-info mode load ] { puts stdout "umask 027;" } if [ module-info mode remove ] { puts stdout "umask 022;" } ... <108> umask 22 ... <113> module load umask <114> umask 27 <115> module unload umask <116> umask 22 As for the font path I use something like this to add a font server for the mathematica fonts (which requires a lot of special math fonts). This saved us from trying to install these fonts for each mathematica user by request. ... if [ module-info mode load ] { if [ llength [ array get env DISPLAY ] ] { exec xset fp+ tcp/newton.nersc.gov:7101 } } if [ module-info mode remove ] { if [ llength [ array get env DISPLAY ] ] { exec xset fp- tcp/newton.nersc.gov:7101 } } ... In this case you use "exec xset" to communicate directly with your X11 window server. As you can see from both of these examples, very little needs to be added to modules, and most of what is needed can be done already by understanding to whom you need to send a command and the underpinnings of modules in Tcl and shell evals. R.K. +-----------------------+----------------------------------+ | R.K.Owen,PhD | rk...@ow... | | KooZ Software | | | NERSC/LBNL | rk...@ne... (510)486-7556 | +-----------------------+----------------------------------+ |