#! /bin/sh -e if [ $# -eq 3 -a "$2" = '-d' ]; then pdir="-d $3" elif [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi case "$1" in -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 esac exit 0 # DP: document /etc/bash.bashrc in bash man page --- bash/doc/bash.1.orig 2008-11-29 17:37:14.000000000 +0000 +++ bash/doc/bash.1 2008-11-29 17:40:07.000000000 +0000 @@ -184,7 +184,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 @@ -215,7 +217,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 @@ -323,13 +327,15 @@ .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. 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 @@ -415,7 +421,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 @@ -9293,6 +9300,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