bash rcfile option incorrectly still loads /etc/bash.bashrc
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
ProcVersionSign
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.4
Architecture: amd64
CasperMD5CheckR
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-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile.