bash rcfile option incorrectly still loads /etc/bash.bashrc

Bug #1890198 reported by Rodney Beede
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
New
Undecided
Unassigned

Bug Description

From the man bash page:

The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrc and ~/.bashrc.

However when I add to /etc/bash.bashrc an echo statement at the top like echo Inside bash.bashrc and then execute:

/bin/bash --rcfile /tmp/some_test -i

where /tmp/some_test has some simple command like an echo statement I still get the echo statement indicating that /etc/bash.bashrc was loaded and run in addition to /tmp/some_test:

Inside bash.bashrc
you are in /tmp/some_test right now

Expected behavior was that since I used the --rcfile option that /etc/bash.bashrc would be ignored and not referenced. Only /tmp/some_test should have been used.

I also tried --noprofile with no change as well as leaving out -i. If I use --norc then /etc/bash.bashrc is correctly not used.

When I use the --rcfile option I expect /etc/bash.bashrc to not be used. If this is going to be the behavior then the man page for bash needs to be updated to state such.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: bash 5.0-6ubuntu1.1
ProcVersionSignature: Ubuntu 5.4.0-42.46-generic 5.4.44
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.4
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Mon Aug 3 15:45:10 2020
InstallationDate: Installed on 2020-08-03 (0 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.bash.bashrc: 2020-08-03T15:31:02.839478

Revision history for this message
Rodney Beede (business2008+launchpad) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.