Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: behaviour of bash with "--login" + "--rcfile" depends on position of argument Date: Mon, 21 Oct 2019 09:43:46 -0400 Lines: 23 Approved: bug-bash@gnu.org Message-ID: References: <1DB406F67241344CB6F3A199E54EF09D25BC525F@MBX2010-K01.ad.fz-juelich.de> <20191021134346.GH28751@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1571665463 26420 209.51.188.17 (21 Oct 2019 13:44:23 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "bug-bash@gnu.org" To: =?iso-8859-1?Q?=22G=F6bbert=2C_Jens_Henrik=22?= Envelope-to: bug-bash@gnu.org Mail-Followup-To: =?iso-8859-1?Q?=22G=F6bbert=2C_Jens_Henrik=22?= , "bug-bash@gnu.org" Content-Disposition: inline In-Reply-To: <1DB406F67241344CB6F3A199E54EF09D25BC525F@MBX2010-K01.ad.fz-juelich.de> 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: <20191021134346.GH28751@eeg.ccf.org> X-Mailman-Original-References: <1DB406F67241344CB6F3A199E54EF09D25BC525F@MBX2010-K01.ad.fz-juelich.de> Xref: csiph.com gnu.bash.bug:15527 On Mon, Oct 21, 2019 at 09:19:48AM +0000, "Göbbert, Jens Henrik" wrote: > Description: > "bash --rcfile --login test.sh" will run test.sh but "bash --login --rcfile test.sh" will not, even though this would be expected from the help/man pages. --rcfile takes an argument. It has to be followed by the name of the rc file that you want bash to read. When you write --rcfile --login you're telling bash that its rc file is named "--login", and that it should read this file, instead of ~/.bashrc, if it needs to read an rc file. However, since you also gave the name of a script to execute, bash doesn't need to read an rc file. So, it simply ignores the --rcfile --login that you gave it, and just executes test.sh. On the other hand, when you write --login --rcfile test.sh you are telling bash that its rc file is named "test.sh", and that it should read this instead of ~/.bashrc if it needs to read an rc file. But since you're using the --login argument, bash doesn't need to read an rc file. So, it doesn't make use of the --rcfile test.sh arguments. You're basically just running bash --login .