** Summary changed:

- bash does not fulfill --bashrc option properly
+ bash does not fulfill --rcfile option properly

** Description changed:

  I am starting a bash shell using
  
- $ bash --noprofile --bashrc my-custom-bash-rc-file
+ $ bash --noprofile --rcfile my-custom-bash-rc-file
  
  Due to the --rcflag, the newly started bash should *not* execute
  commands from /etc/bash.bashrc. That is at least how I interpret `man
  bash`:
  
-       --rcfile file
-               Execute commands from file instead of the system wide 
initialization file /etc/bash.bashrc and the standard personal initial‐
-               ization file ~/.bashrc if the shell is interactive (see 
INVOCATION below). 
+       --rcfile file
+               Execute commands from file instead of the system wide 
initialization file /etc/bash.bashrc and the standard personal initial‐
+               ization file ~/.bashrc if the shell is interactive (see 
INVOCATION below).
  
  However, it seems that the commands in /etc/bash.bashrc are in fact
  executed.
  
  To see/reproduce/diagnose this, on Ubuntu I believe one can just invoke
  bash like this (as the regular user):
  
  $ touch testrc
- $ env -i bash --noprofile --rcfile testrc 
+ $ env -i bash --noprofile --rcfile testrc
  
  The expected result would be that nothing special is printed on the
  terminal. However, there is an error message, which is printed from
  /etc/bash.bashrc. The "env -i" causes $HOME to not be set in the invoked
  shell, which in turn triggers the error. The error message is:
  
  > To run a command as administrator (user "root"), use "sudo <command>".
- > See "man sudo_root" for details. 
+ > See "man sudo_root" for details.
  
  Another way to see this -- without the "env -i" -- is to add  a command
  to /etc/bash.bashrc, such as
  
  echo HELLO THERE
  
  To trigger the bug(?), one can then just do
  
  $ touch testrc
- $ bash --noprofile --bashrc testrc
+ $ bash --noprofile --rcfile testrc
  
  The expected result would be that nothing special is shown in the
  terminal. However, it turns out that the string
  
  HELLO THERE
  
  is printed.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1097467

Title:
  bash does not fulfill --rcfile option properly

Status in bash package in Ubuntu:
  Confirmed

Bug description:
  I am starting a bash shell using

  $ bash --noprofile --rcfile my-custom-bash-rc-file

  Due to the --rcflag, the newly started bash should *not* execute
  commands from /etc/bash.bashrc. That is at least how I interpret `man
  bash`:

        --rcfile file
                Execute commands from file instead of the system wide 
initialization file /etc/bash.bashrc and the standard personal initial‐
                ization file ~/.bashrc if the shell is interactive (see 
INVOCATION below).

  However, it seems that the commands in /etc/bash.bashrc are in fact
  executed.

  To see/reproduce/diagnose this, on Ubuntu I believe one can just
  invoke bash like this (as the regular user):

  $ touch testrc
  $ env -i bash --noprofile --rcfile testrc

  The expected result would be that nothing special is printed on the
  terminal. However, there is an error message, which is printed from
  /etc/bash.bashrc. The "env -i" causes $HOME to not be set in the
  invoked shell, which in turn triggers the error. The error message is:

  > To run a command as administrator (user "root"), use "sudo <command>".
  > See "man sudo_root" for details.

  Another way to see this -- without the "env -i" -- is to add  a
  command to /etc/bash.bashrc, such as

  echo HELLO THERE

  To trigger the bug(?), one can then just do

  $ touch testrc
  $ bash --noprofile --rcfile testrc

  The expected result would be that nothing special is shown in the
  terminal. However, it turns out that the string

  HELLO THERE

  is printed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1097467/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to