Re: nasty env vars
Manage your shell environment variables and aliases
Brought to you by:
leomania,
xdelaruelle
From: Mark L. <la...@mi...> - 2002-04-11 09:28:22
|
I'm not sure who the vendor is (since I don't know) but the variable name is PIVOTDB. It is some tool for EDA, although only the support folks use it, not R&D. Actually toying around with this, I decided to fix the modules command itself. I've got it working (finally), but there are some other fixes I would like to put in before releasing it, especially related to the init scripts and the configure script. And in the meantime, I made the module generate a source-able file, instead of the eval. This of course is not unloadable, but at least it hides the details from the user for a while. -Mark #%Module1.0 set stream none if [module-info mode load] { set stream stdout } if [module-info mode display] { set stream stderr } set cmd(sh) ". /foo/bar/init.sh" set cmd(csh) "source /foo/bar/init.csh" if [info exists cmd([module-info shelltype])] { set cmdx $cmd([module-info shelltype]) if {$stream != "none"} { puts -nonewline $stream "$cmdx ;" flush $stream } } Mark Lakata, Staff Engineer 1225 Charleston Road voice 650-567-5170 MIPS Technologies Mountain View CA 94043 fax 650-567-5002 On Wed, 10 Apr 2002, Leo Butler wrote: > Mark Lakata wrote: > > > We have one piece of software that requires a nasty env var to be > > set. The environment variable contains double-quotes and curly > > braces, for example: > > > > BEGIN{require"/foo/init.pl"} > > > > (perl hackers will recognize that as perl syntax. Don't ask me who > > decided to store a perl one-liner in an env var!) > > Hello, Mark. > > Sorry, I'm gonna do it... WHO IN THE @*)!(*&% did this? I > am guessing it's some bit of EDA software code, but I just > gotta know. > > > In csh, you can set it with > > > > setenv FOO 'BEGIN{require"/foo/init.pl"}' > > > > However, you will be hardpressed to get this to work in a module! > > Try it! The double quotes and the curly braces will ruin your day, > > so if you tried that line "as is" in your modulefile, you will get > > [snip] > > I'd like to find a modules solution, but 30 minutes of experiments > has left me as frustrated as you (no, you probably fought with it > for longer than that...) so I'm going to suggest a punt -- > > Make a wrapper script. > > We've been forced into this on some programs due to overruning the > PATH with all of the EDA tools we wish to load on a per-project > basis, so it wouldn't be totally without precedent in our env. I > hope that's not too outside the norm in yours. > > And in parallel, if the developer is still actively supporting the > program, ask him/her to fix it. That's just plain nasty IMHO. > > Regards, > > - Leo > > |