Bash features a built-in command "source scriptname.sh
#my scriptfile
LD_LIBRARY_PATH=/my/nonstandard/dir/local/lib
export LD_LIBRARY_PATH
CPLUS_INCLUDE_PATH=/my/nonstandard/dir/local/include
export CPLUS_INCLUDE_PATH
LIBRARY_PATH=/my/nonstandard/dir/local/lib
export LIBRARY_PATH
cd /take/me/to/the/basedir/of/my/code/project
which, as a bonus, brings me straight to the right working directory to get on the job...
I found this solution starting here from a google search. The gcc variables are described in the book "An introduction to GCC" by Brian Gough, which is in fact also available online.
No comments:
Post a Comment