I'm running bash in Ubuntu, and I'm trying to run a computational chemistry program called Gaussian 16. My colleague tells me that he is able to run Gaussian 16 by adding the following lines to his .bashrc
file:
export g16root=/g16root
source $g16root/g16/bsd/g16.profile
My colleague says that once he adds those lines to his .bashrc
file, he can run Gaussian 16 using the command g16 <input file>
, where <input file>
is the required input file.
My .bashrc
file is in my home directory (~
, in other words /export/home/myusername/
). When I add those above two lines to my .bashrc
file and then attemptg16 <input file>
, bash tells me it doesn't know what g16
is ("g16: command not found
").
HOWEVER, if I execute (separately) those above two lines in bash (i.e., the above export
and source
commands), then bash knows what g16
is: g16 <input file>
runs the software, and additionally, which g16
gives /g16root/g16/g16
. So this works, but I have to reenter the export
and source
commands every time I log in to the (remote) machine.
Please bear with me since I'm a bash novice, but how do I get bash to "execute" the export
and source
commands in my .bashrc
file?
In case it's helpful, the entirety of my .bashrc
file (other than commented lines) is now the following:
test -s ~/.alias && . ~/.alias || true
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export g16root=/g16root
source $g16root/g16/bsd/g16.profile
(I don't know why the first two blocks of code are there.)
Also, executing echo $BASH_VERSION
gives 4.1.5(1)-release
, so apparently I am actually using bash.
echo hello
ortouch ~/testfile
in the.bashrc
file to see if it even gets processed properly (Bash by itself doesn't read.bashrc
for login shells, just the.profile
files etc. Usually they'd also read.bashrc
, but...) Also, runecho $BASH_VERSION
to check that it's actually Bash you're running (and not ksh or zsh, or whatever)~/.bashrc
whenever you start an interactive shell. Merely adding the lines to the files won't do much. Starting a new terminal, or logging out and in again, will cause the shell to run the added lines.echo $BASH_VERSION
, the terminal gives4.1.5(1)-release
..bashrc
when you need to modify the one on the remote server. Also:.profile
should also source.bashrc
(if BASH is detected as shell). And: How do you do the login?