Making Cygwin look at your .bashrc

Having recently installed Cygwin on my windows machine in order to get access to helpful Unix stuff like Git, I soon found the need to set some custom defaults, such as the PATH variable. The standard way to do this is to create a file called .bashrc in your home directory, containing something like this:

PATH=$PATH:/cygdrive/c/mysql4.1.36/bin
export PATH

Creating this file, and then launching the bash command worked fine for me, but when it came to launching Cygwin directly, it would ignore my .bashrc and start from a clean slate every time.

Looking around on the internet I came across two solutions:

  1. Type into the Cygwin shell:

    cp -p /etc/defaults/etc/skel/.bash_profile ~
  2. Add to the end of /etc/profile:

    . "$HOME/.bashrc"

I did both of these and it fixed my problem, but you may only need one.

One Response to “Making Cygwin look at your .bashrc”

  1. Tom S says:

    Worked like a charm!

Leave a Reply