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@prep.ai.mit.edu.
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
27 alpha*|beta*) BUGBASH=chet@po.cwru.edu ;;
28 *) BUGBASH=bug-bash@prep.ai.mit.edu ;;
35 : ${USER=${LOGNAME-`whoami`}}
37 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
38 trap 'rm -f $TEMP $TEMP.x' 0
41 if (uname) >/dev/null 2>&1; then
45 if [ -f /usr/lib/sendmail ] ; then
46 RMAIL="/usr/lib/sendmail"
47 elif [ -f /usr/sbin/sendmail ] ; then
48 RMAIL="/usr/sbin/sendmail"
56 Subject: [50 character or so descriptive subject here (for reference)]
58 Configuration Information [Automatically generated, do not change]:
62 Compilation CFLAGS: $CFLAGS
64 Machine Type: $MACHTYPE
66 Bash Version: $RELEASE
67 Patch Level: $PATCHLEVEL
68 Release Status: $RELSTATUS
71 [Detailed description of the problem, suggestion, or complaint.]
74 [Describe the sequence of events that causes the problem
78 [Description of how to fix the problem. If you don't know a
79 fix for the problem, don't include this section.]
85 # Figure out how to echo a string without a trailing newline
92 trap '' 2 # ignore interrupts while in editor
94 until $EDITOR $TEMP; do
95 echo "$0: editor \`$EDITOR' exited with nonzero status."
96 echo "$0: Perhaps it was interrupted."
97 echo "$0: Type `y' to give up, and lose your bug report;"
98 echo "$0: type `n' to re-enter the editor."
99 echo $n "$0: Do you want to give up? $c"
107 trap 'rm -f $TEMP $TEMP.x; exit 1' 2 # restore trap on SIGINT
109 if cmp -s $TEMP $TEMP.x
111 echo "File not changed, no bug report submitted."
115 ${RMAIL} $BUGADDR < $TEMP || {
116 cat $TEMP >> $HOME/dead.bashbug
117 echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2