3 # bashbug - create a bug report and mail it to the bug address
5 # The bug address depends on the release status of the shell. Versions
6 # with status `alpha' or `beta' mail bug reports to chet@po.cwru.edu.
7 # Other versions send mail to bug-bash@gnu.org.
9 # configuration section:
10 # these variables are filled in by the make target in cpp-Makefile
17 PATCHLEVEL="!PATCHLEVEL!"
18 RELSTATUS="!RELSTATUS!"
21 PATH=/bin:/usr/bin:/usr/local/bin:$PATH
26 # Figure out how to echo a string without a trailing newline
33 BASHTESTERS="bash-testers@po.cwru.edu"
36 alpha*|beta*) BUGBASH=chet@po.cwru.edu ;;
37 *) BUGBASH=bug-bash@gnu.org ;;
41 alpha*|beta*) echo "$0: This is a testing release. Would you like your bug report"
42 echo "$0: to be sent to the bash-testers mailing list?"
43 echo $n "$0: Send to bash-testers? $c"
46 y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;;
50 BUGADDR="${1-$BUGBASH}"
54 : ${USER=${LOGNAME-`whoami`}}
56 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
57 trap 'rm -f $TEMP $TEMP.x' 0
60 if (uname) >/dev/null 2>&1; then
64 if [ -f /usr/lib/sendmail ] ; then
65 RMAIL="/usr/lib/sendmail"
66 elif [ -f /usr/sbin/sendmail ] ; then
67 RMAIL="/usr/sbin/sendmail"
78 Subject: [50 character or so descriptive subject here (for reference)]
80 Configuration Information [Automatically generated, do not change]:
84 Compilation CFLAGS: $CFLAGS
86 Machine Type: $MACHTYPE
88 Bash Version: $RELEASE
89 Patch Level: $PATCHLEVEL
90 Release Status: $RELSTATUS
93 [Detailed description of the problem, suggestion, or complaint.]
96 [Describe the sequence of events that causes the problem
100 [Description of how to fix the problem. If you don't know a
101 fix for the problem, don't include this section.]
104 # this is still raceable
109 trap '' 2 # ignore interrupts while in editor
111 until $EDITOR $TEMP; do
112 echo "$0: editor \`$EDITOR' exited with nonzero status."
113 echo "$0: Perhaps it was interrupted."
114 echo "$0: Type \`y' to give up, and lose your bug report;"
115 echo "$0: type \`n' to re-enter the editor."
116 echo $n "$0: Do you want to give up? $c"
124 trap 'rm -f $TEMP $TEMP.x; exit 1' 2 # restore trap on SIGINT
126 if cmp -s $TEMP $TEMP.x
128 echo "File not changed, no bug report submitted."
132 echo $n "Send bug report? [y/n] $c"
138 ${RMAIL} $BUGADDR < $TEMP || {
139 cat $TEMP >> $HOME/dead.bashbug
140 echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2