Defining aliases in bash
echo " ******** Executing .bashrc on MickMac ********"
alias ls='ls -l'
echo " ******** Completed .bashrc on MickMac ********"
The .bashrc file certainly seems to run when I start up a terminal (I have the Terminal preferences set to run ~/.bashrc at startup), but strangely the alias command within it doesn't seem to take. However, if I subsequently manually source the .bashrc file then the alias does work. I'm sure I'm doing something stupid...
Here is the output of a terminal window right after freshly logging in:
Last login: Mon Jun 23 09:34:08 on ttys000
mueckmbp:~ mmueckti$ ~/.bashrc <------ done automatically
******** Executing .bashrc on MickMac ********
******** Completed .bashrc on MickMac ********
mueckmbp:~ mmueckti$ alias <------ my 1st command
mueckmbp:~ mmueckti$ source ~/.bashrc <------ my 2nd command
******** Executing .bashrc on MickMac ********
******** Completed .bashrc on MickMac ********
mueckmbp:~ mmueckti$ alias <------ my 3rd command
alias ls='ls -l'
mueckmbp:~ mmueckti$ ls -l ~/.bashrc <------ my 4th command
-rwxrwxrwx@ 1 mmueckti 33024 887 Jun 23 09:38 /Users/mmueckti/.bashrc
mueckmbp:~ mmueckti$
Annoyingly, if I also type 'man alias' into the terminal window I don't really get any information on the alias command!
Could some kind person please point out what I'm doing wrong.
Thanks,
Mick
17" MacBook Pro C2D, Mac OS X (10.5)