0

But, they still work after source .bash_aliases.

I have the following lines in my .bashrc:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

This is supposed to be equivalent to typing source .bash_aliases, isn't it?

Benjamin
  • 202

3 Answers3

1

I figured it out; it was caused by my having created a .bash_profile in following a tutorial to set up a GPG key. In the presence of a .bash_profile file, the entire .bashrc file is ignored.

Benjamin
  • 202
0

Try to place the same alias in bash_profile file also. And restart your terminal

Jay
  • 101
  • 2
0

From man [:

   -f FILE
          FILE exists and is a regular file

Since you made .bash_aliases a link, this test is failing. Either make it a regular file and not a soft link, or change this test.