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?
if [ -f /usr/local/lib/bash_profile ]; then
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
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.
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".
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:
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:
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