in /etc/profile.d/foo.sh I have:
set -o vi
export ECLIPSE_HOME=/usr/local/eclipse
alias eclipse=${ECLIPSE_HOME}/eclipse
After rebooting my Ubuntu 11.10 32-bit install, and after logging in from the GUI and opening a terminal as a regular user, and type alias eclipse the alias is not defined: bash: alias: eclipse: not found
If I then do sudo su - and then alias eclipse then I correctly get alias eclipse='/usr/local/eclipse/eclipse'
Just to be sure, if I then do (as root) su - myusername and then alias eclipse then I correctly get alias eclipse='/usr/local/eclipse/eclipse'
What gives?
It’s better to set aliases in bashrc than in profile. profile is only read if you start a login shell. bashrc is read whenever you start an interactive shell.