You should enclose code samples in a CODE block to preserve indentation when posting them. The
if command syntax looks OK to me. Is bash or sh your default shell?
Code:
if [ -f /usr/local/lib/bash_profile ]; then
. /usr/local/lib/bash_profile
fi
Bash expects the system startup script to be located in /etc/profile. This location is not standard so it is sourced if it exists. Since you added spaces which look like little dots, I can't tell if the second line is
Code:
. /usr/local/lib/bash_profile
or /usr/local/lib/bash_profile
or ./usr/local/lib/bash_profile
The first will source the /usr/local/lib/bash_profile file.
The second will run /usr/local/lib/bash_profile in a subshell, so changes in that script won't be retained.
The third will run $HOME/usr/local/lib/bash_profile. See if this script exists.
Code:
export PATH=$PATH:/home/pyuet/usr/local/gromacs-3.3.1/bin
This line will add /home/pyuet/usr/local/gromacs-3.3.1/bin/ to your $PATH variable. This line looks correct if you are using the bash or sh shell.
If you are using another shell, then /home/pyuet/.profile may not be sourced when you login.
Look at the output of "grep pyuet /etc/passwd".
Code:
pyuet:x:1000:1001:The Great Mr Pyuet:/home/pyuet:/bin/bash
The last field will contain something like /bin/bash or /bin/sh or /bin/csh or /bin/tsh.
You can change your default shell with the "chsh" command. (see man chsh).
The possible shells are listed in /etc/shells:
example:
Code:
cat /etc/shells
/bin/ash
/bin/bash
/bin/bash1
/bin/csh
/bin/false
/bin/ksh
/bin/sh
/bin/tcsh
/bin/true
/bin/zsh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/passwd
/usr/bin/bash
/usr/bin/rbash
/usr/bin/tcsh
/usr/bin/zsh
Don't select /bin/true or /bin/false of course. /usr/false is used for system user accounts to prevent logins on that account.
One other thing to note. Even if you are using the /bin/bash shell, it is only sourced when you login.
There is another way of doing the test in your ~/.profile script. You can use the test command:
Code:
From my ~/.profile:
test -z "$PROFILEREAD" && . /etc/profile
Your three lines could be instead:
test -f /usr/local/lib/bash_profile && . /usr/local/lib/bash_profile