Bash – Why is the .bashrc not read under cygwin

bashbashrccygwin

My .bashrc looks like this:

alias name@server="ssh server sname"
echo "bashrc read"

The echo statement is just for checking if it is read. But the echo does nothing. I want to set an alias for a quicker ssh into a box doing a certain command which is a working alias on the remote box.

Best Answer

I haven't used cygwin in some time, but I'm guessing that it wants ~/.bash_profile. Simple fix to test.

ln -s ~/.bashrc ~/.bash_profile

Or if ~/.bash_profile exists, source .bashrc.

if [ -f ~/.bashrc ]
then
  . ~/.bashrc
fi