I'd like to source a file inside a tcsh script. In code:
#!/bin/tcsh unsetenv LD_LIBRARY_PATH source $1 echo $LD_LIBRARY_PATH > temp_file
The expected result: The environment variable set by the script using the source command will be printed into a temporary file.
Actual result: The sourced file runs nicely, but the
LD_LIBRARY_PATH variable remains empty.
Any ideas on how to get this to work?
tcsh is of course not my shell of choice, but I have a script at work that sets up numerous environment variables in
tcsh that I want to get working in
bash. I figured the easiest way (other than rewriting the
tcsh shell every time) is to source it, print out the variables into a file, and with a bit of shell magic, re-source everthing back in bash.