Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?iso-8859-1?Q?=22G=F6bbert=2C_Jens_Henrik=22?= Newsgroups: gnu.bash.bug Subject: RE: behaviour of bash with "--login" + "--rcfile" depends on position of argument Date: Mon, 21 Oct 2019 14:08:59 +0000 Lines: 59 Approved: bug-bash@gnu.org Message-ID: References: <1DB406F67241344CB6F3A199E54EF09D25BC525F@MBX2010-K01.ad.fz-juelich.de>, <20191021134346.GH28751@eeg.ccf.org> <1DB406F67241344CB6F3A199E54EF09D25BC5457@MBX2010-K01.ad.fz-juelich.de> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1571666950 27577 209.51.188.17 (21 Oct 2019 14:09:10 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "bug-bash@gnu.org" To: Greg Wooledge Envelope-to: bug-bash@gnu.org Authentication-Results: mailgw-e01.its.kfa-juelich.de (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=fz-juelich.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fz-juelich.de; h= mime-version:content-transfer-encoding:content-type:content-type :content-language:accept-language:in-reply-to:references :message-id:date:date:subject:subject:from:from:received :received:received; s=main; t=1571666940; bh=+9Hoc9U9spyUvCtcEgu uiCHaM0U021ZKRa4++AoOQ5g=; b=y4RLMMhzO/hAXibHLJHExa1GqF4jMVIv/sY SdUzq0rOder3kXrNLIA/UCqqYIh1YwyDf9JWGOKBbT9S6cGfV9+RPagx+qsnL3B7 MzxbGrF8vhGJgg2JGbES++AfJxQ424Hz+AeSmzPrTv8Rt84d9JaT1QHPL4QqoUei rCHJRv8E= X-Virus-Scanned: Debian amavisd-new at mailgw-e01.its.kfa-juelich.de Thread-Topic: behaviour of bash with "--login" + "--rcfile" depends on position of argument Thread-Index: AdWH8K9sMyD3HHd3R+yFXgN9hrmc0AAFByAAAAUJRAA= In-Reply-To: <20191021134346.GH28751@eeg.ccf.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [134.94.171.105] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 134.94.4.38 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: <1DB406F67241344CB6F3A199E54EF09D25BC5457@MBX2010-K01.ad.fz-juelich.de> X-Mailman-Original-References: <1DB406F67241344CB6F3A199E54EF09D25BC525F@MBX2010-K01.ad.fz-juelich.de>, <20191021134346.GH28751@eeg.ccf.org> Xref: csiph.com gnu.bash.bug:15528 Thank you, Greg, for the good explanation and your time and sorry for the wrong bug-report. Best, Jens Henrik ________________________________________ From: Greg Wooledge [wooledg@eeg.ccf.org] Sent: Monday, October 21, 2019 3:43 PM To: G=F6bbert, Jens Henrik Cc: bug-bash@gnu.org Subject: Re: behaviour of bash with "--login" + "--rcfile" depends on posit= ion of argument On Mon, Oct 21, 2019 at 09:19:48AM +0000, "G=F6bbert, Jens Henrik" wrote: > Description: > "bash --rcfile --login test.sh" will run test.sh but "bash --logi= n --rcfile test.sh" will not, even though this would be expected from the h= elp/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 . ---------------------------------------------------------------------------= --------------------- ---------------------------------------------------------------------------= --------------------- Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Volker Rieke Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt ---------------------------------------------------------------------------= --------------------- ---------------------------------------------------------------------------= ---------------------