On Mon, 06 Feb 2012 16:59:47 -0200 Rodrigo Silva <li...@rodrigosilva.com> wrote: > User should be able to prevent system rc and selecting a custom rc by using the --rcfile option, as per the documentation. > ... > This was also reported (and submited) in upstream https://savannah.gnu.org/support/index.php?107950
Chet Ramey (an upstream Project Admin for Bash) rejected that report, saying Debian's documentation is wrong. Convincing Chet that the behaviour in Debian's documentation is preferable to the current behaviour seems hard considering his 3-year response time. I propose changing the documentation. The Debian file debian/patches/man-bashrc.diff is affected. I attached a new version of man-bashrc.diff, without the two parts that change the documentation of --rcfile. I've also attached a patch (man-bashrc.diff.patch) to get from the original man-bashrc.diff to my proposed man-bashrc.diff. Regards, Tom Levy
# DP: document /etc/bash.bashrc in bash man page --- a/bash/doc/bash.1 +++ b/bash/doc/bash.1 @@ -213,7 +213,9 @@ below). .TP .B \-\-norc -Do not read and execute the personal initialization file +Do not read and execute the system wide initialization file +.I /etc/bash.bashrc +and the personal initialization file .I ~/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as @@ -321,7 +323,8 @@ .PP When an interactive shell that is not a login shell is started, .B bash -reads and executes commands from \fI~/.bashrc\fP, if that file exists. +reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, +if these files exist. This may be inhibited by using the .B \-\-norc option. @@ -413,7 +416,8 @@ If .B bash determines it is being run in this fashion, it reads and executes -commands from \fI~/.bashrc\fP, if that file exists and is readable. +commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files +exist and are readable. It will not do this if invoked as \fBsh\fP. The .B \-\-norc @@ -9825,6 +9829,9 @@ .FN /etc/profile The systemwide initialization file, executed for login shells .TP +.FN /etc/bash.bashrc +The systemwide per-interactive-shell startup file +.TP .FN ~/.bash_profile The personal initialization file, executed for login shells .TP
--- bash-4.2+dfsg.orig/debian/patches/man-bashrc.diff +++ bash-4.2+dfsg/debian/patches/man-bashrc.diff @@ -2,18 +2,7 @@ --- a/bash/doc/bash.1 +++ b/bash/doc/bash.1 -@@ -182,7 +182,9 @@ - .PD - Execute commands from - .I file --instead of the standard personal initialization file -+instead of the system wide initialization file -+.I /etc/bash.bashrc -+and the standard personal initialization file - .I ~/.bashrc - if the shell is interactive (see - .SM -@@ -213,7 +215,9 @@ +@@ -213,7 +213,9 @@ below). .TP .B \-\-norc @@ -24,7 +13,7 @@ .I ~/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as -@@ -321,13 +325,15 @@ +@@ -321,7 +323,8 @@ .PP When an interactive shell that is not a login shell is started, .B bash @@ -34,15 +23,7 @@ This may be inhibited by using the .B \-\-norc option. - The \fB\-\-rcfile\fP \fIfile\fP option will force - .B bash --to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. -+to read and execute commands from \fIfile\fP instead of -+\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. - .PP - When - .B bash -@@ -413,7 +419,8 @@ +@@ -413,7 +416,8 @@ If .B bash determines it is being run in this fashion, it reads and executes @@ -52,7 +33,7 @@ It will not do this if invoked as \fBsh\fP. The .B \-\-norc -@@ -9830,6 +9837,9 @@ +@@ -9825,6 +9829,9 @@ .FN /etc/profile The systemwide initialization file, executed for login shells .TP