This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: .bashrc not sourced
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin at cygwin dot com
- Date: Tue, 29 Mar 2016 13:03:54 -0400
- Subject: Re: .bashrc not sourced
- Authentication-results: sourceware.org; auth=none
- References: <CABdLNwARbwP_QXox3Owc1AHF174Ut5c010z12-wFWsm-hxoPvA at mail dot gmail dot com>
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