What does this example bash startup script do?
- by Dimitri
I am trying to set up GNU Octave on my computer (Mac OS X 10.7.4). I am newbie in using Terminal and I need help to understand what the following script actually does:
if [ -f ~/.bashrc ];then<br>
. ~/.bashrc<br>
fi<br>
PATH=$PATH:/usr/local/bin<br>
BASH_ENV=~/.bashrc<br>
export BASH_ENV PATH<br>
export GNUTERM=aqua<br>
alias octave="/Applications/Octave.app/Contents/Resources/bin/octave"<br>
alias gnuplot="/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot"<br>
(taken from here: http://wikibox.stanford.edu/me112/index.php/Main/OctaveMatlabNotes)
So this script begins with the simple conditional if statement. I don't understand the conditional expression - what is -f and .bashrc? What the statement . ~/.bashrc actually does?
Then 2 variables are defined PATH and BASH_ENV. Why are they exported? Why GNUTERM=aqua is exported even if it's not defined anywhere?
All I need is a script that would allow me to run Octave by simply typing octave in the terminal. I don't need an alias for the gnu plot.
Thanks