unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29337: Bash reads system-wide bashrc unconditionally.
@ 2017-11-17 12:16 Roel Janssen
  2017-11-17 21:04 ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Roel Janssen @ 2017-11-17 12:16 UTC (permalink / raw)
  To: 29337

Dear Guix,

This is more of an issue for GuixSD.
Our 'bash' package seems to behave differently from other distributions
(like CentOS 7), and it behaves differently from the way described in its
manual page.

I added the following line to /etc/bashrc:
echo "Hello, world"

Here's the command to reproduce the problem:
$ env - bash --init-file <(echo "echo \"Goodbye, world\"") -i
Hello, world
Goodbye, world


From the manpage:
...
       -i        If the -i option is present, the shell is interactive.
...
       --init-file file
       --rcfile file
              Execute commands from file instead of the standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below).
...


So, what should happen, is that it ignores the system-wide initialization
file (and the user's initialization file).

On CentOS 7, the following happens (yes, I added the echo-statement to
/etc/bashrc on CentOS as well):
$ env - bash --init-file <(echo "echo \"Goodbye, world\"") -i
Goodbye, world

On GuixSD:
$ env - bash --init-file <(echo "echo \"Goodbye, world\"") -i
Hello, world
Goodbye, world

Where does this difference come from?  And could we make its behavior
similar to CentOS 7, and more importantly, to the description in the
manpage?

Kind regards,
Roel Janssen

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-11 15:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 12:16 bug#29337: Bash reads system-wide bashrc unconditionally Roel Janssen
2017-11-17 21:04 ` Ludovic Courtès
2017-11-20 21:48   ` Roel Janssen
2017-11-21  8:50     ` Ludovic Courtès
2017-11-24 15:46       ` Roel Janssen
2017-11-24 20:51         ` Ludovic Courtès
2017-12-11 11:35           ` Roel Janssen
2017-12-11 13:19             ` Ludovic Courtès
2017-12-11 15:31               ` Roel Janssen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).