.bashrc not sourced

Ken Brown kbrown@cornell.edu
Tue Mar 29 17:03:00 GMT 2016


On 3/29/2016 11:04 AM, Gary Furash wrote:
> When I log on w/ Mintty or Bash (via the bat file) it takes me to my
> home directory but doesn't automatically source .bashrc.

It's only in non-login shells that .bashrc gets sourced by default.  If 
you want it to be sourced in login shells, you should do that in your 
~/.bash_profile file.  (See the section on startup files in the bash 
manual.)

For example, here's what the default .bash_profile does:

$ cat /etc/defaults/etc/skel/.bash_profile
[...]
# ~/.bash_profile: executed by bash(1) for login shells.
[...]
# User dependent .bash_profile file

# source the users bashrc if it exists
if [ -f "${HOME}/.bashrc" ] ; then
   source "${HOME}/.bashrc"
fi

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list