This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .bashrc not sourced


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]