Re: module which ?
Manage your shell environment variables and aliases
Brought to you by:
leomania,
xdelaruelle
From: Nils S. <sm...@pd...> - 2002-04-18 13:55:27
|
It sounds like a slow process to parse each module, evaluate the final path, and then see if it matches the intended binary. Not to mention that a module can behave differently depending on what other modules are loaded (or not loaded) at the time of the load. I think it is just about as accurate and probably easier to do something like (in csh syntax): set target=/usr/local/tuxracer # I am looking for /usr/local/tuxracer/bin/tuxrace foreach moddir ( `echo $MODULEPATH | awk -F: '{ for(i=1;i<=NF;i++) {print $i} }'` ) echo Searching $moddir find $moddir -type f -exec grep -q $target \{\} \; -print end Searching /usr/local/lib/module/modules /usr/local/lib/module/modules/tux/1.0 So the relevant module is tux/1.0 It won't work everytime, but you will probably find your module quicker this way. /Nils Smeds |