Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: Unexpected sourcing of ~/.bashrc under ssh Date: Thu, 24 Oct 2019 10:47:52 -0400 Lines: 14 Approved: bug-bash@gnu.org Message-ID: References: <27440.1571900467@kermit.inria.fr> <20191024144752.GF1408@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1571928513 24334 209.51.188.17 (24 Oct 2019 14:48:33 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Francis.Montagnac@inria.fr Envelope-to: bug-bash@gnu.org Mail-Followup-To: Francis.Montagnac@inria.fr, bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <27440.1571900467@kermit.inria.fr> User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20191024144752.GF1408@eeg.ccf.org> X-Mailman-Original-References: <27440.1571900467@kermit.inria.fr> Xref: csiph.com gnu.bash.bug:15535 On Thu, Oct 24, 2019 at 09:01:07AM +0200, Francis.Montagnac@inria.fr wrote: > When logged on a machine with ssh, executing a simple command CMD1 > that spawn a "/bin/bash -c some other command" do not source > ~/.bashrc: normal behaviour. > > When executing "CMD1 | CMD2", the ~/.bashrc is sourced: wrong . Bash can be built with a compile-time option that causes it to try to detect when it's the non-interactive child of an ssh session, and source the user's ~/.bashrc under those conditions. Many Linux distributions enable this option, because they believe that their users expect this behavior.