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?
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.
.bash_profile
file causes the .bashrc
to be ignored. The situations in which bash sources the two are different. However, .bash_profile
takes precedence over .profile
, which is used by default on Ubuntu, and the default Ubuntu version sources .bashrc
: http://askubuntu.com/questions/432508/why-does-ubuntus-default-profile-source-bashrc, hence the overall effect.
– muru
Mar 10 '17 at 17:28
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.
man bash
says "Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself." though
– steeldriver
Mar 04 '17 at 02:04
source
the file explicitly every time you start a shell? – Zanna Mar 03 '17 at 21:36I do have my .bash_aliases stored in my Dropbox, with ~/.bash_aliases as a symlink to ~/Dropbox/.bash_aliases, but that shouldn't matter, right?
– Benjamin Mar 03 '17 at 22:04