swincas / cookies-n-code

A repo for code review sessions at CAS
http://astronomy.swin.edu.au/
MIT License
30 stars 34 forks source link

script which purges environment and load module not working #26

Closed jamesesdaile closed 6 years ago

jamesesdaile commented 6 years ago

I have a script which loads various modules after deactivating environment but after running script the environment remains.

script.sh:

source deactivate module purge module load moog/july2014

I'm running the code with ./script.sh

jamesesdaile commented 6 years ago

issue resolved: running the script with ./ has everything run as a subprocess and doesn't impact the terminal environment. Need to run source script.sh to have the environment affected.

manodeep commented 6 years ago

The solution was to source script.sh -- that executes everything within script.sh in the current shell