I am using csh scripts for some automation purpose. I have a number of scripts, and the beginning of all of which I need to set a fixed set of environment variables.
|----SCRIPT 1---| |----SCRIPT 2---| |# set env vars | |# set env vars | | | | | |# do something | |# do something | | | |# else |
So I thought that I'll put all the environment variables in another script and source it from each file. But as it turns out, environment variables set inside the sourced script are not reflected outside. Is there any clean way to achieve what I want? Or do I have to explicitly set environment variables in each script ?
While sourcing the file, I was piping the output to a file using the 'tee' command. I noticed that after removing the pipe, the script file worked.