In my ~/.shortcuts
, I have symlinks to some frequently used directories.
In .bashrc
(OS X), I am doing this:
ls -1 ~/.shortcuts | xargs -I {} alias {}="'cd -P ~/.shortcuts/{}'"
When I run alias
in the terminal, the output shows the newly added aliases but none of the aliases work. Why?
I have some aliases like alias ll='ls -l'
defined in .bash_aliases
. Doing . ~/.bash_aliases
in .bashrc
loads my custom aliases perfectly well. But, when I redirect the xargs -t
output to a tmp file and source it in bashrc (just like I source .bash_aliases
), it doesn't work.
What am I doing wrong?