Public bug reported: >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 ** Affects: bash (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug focal -- 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/1890198 Title: bash rcfile option incorrectly still loads /etc/bash.bashrc Status in bash package in Ubuntu: New 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 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1890198/+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