Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15528 > unrolled thread

RE: behaviour of bash with "--login" + "--rcfile" depends on position of argument

Started by"Göbbert, Jens Henrik" <j.goebbert@fz-juelich.de>
First post2019-10-21 14:08 +0000
Last post2019-10-21 14:08 +0000
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: behaviour of bash with "--login" + "--rcfile" depends on position of argument "Göbbert, Jens Henrik" <j.goebbert@fz-juelich.de> - 2019-10-21 14:08 +0000

#15528 — RE: behaviour of bash with "--login" + "--rcfile" depends on position of argument

From"Göbbert, Jens Henrik" <j.goebbert@fz-juelich.de>
Date2019-10-21 14:08 +0000
SubjectRE: behaviour of bash with "--login" + "--rcfile" depends on position of argument
Message-ID<mailman.1388.1571666949.9715.bug-bash@gnu.org>
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öbbert, Jens Henrik
Cc: bug-bash@gnu.org
Subject: Re: behaviour of bash with "--login" + "--rcfile" depends on position of argument

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   .


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web