LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   loading modules using script files? (https://www.linuxquestions.org/questions/linux-newbie-8/loading-modules-using-script-files-650372/)

antonodnako 06-19-2008 01:32 PM

loading modules using script files?
 
It should be a silly question but here it is.

I wanted to load modules using script file:

#!/bin/csh
# load intel C compilers
module load mpich-intel
module list

During execution script echoes that the module was loaded. After execution the same command line "module list" shows that no modules are available. Why is that?

Tinkster 06-19-2008 01:39 PM

Hi,

And welcome to LQ!

Because you're spawning a sub-shell. And those modules,
I presume, are quite distinct from kernel modules, so
will terminate with the script.


Cheers,
Tink

P.S.: Try to avoid csh for scripting.
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/


All times are GMT -5. The time now is 01:02 PM.