home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09964.iso / unix / ALL.ZIP / bin / bashbug < prev    next >
Encoding:
Text File  |  1996-04-13  |  2.0 KB  |  85 lines

  1. #!/bin/sh -
  2. #
  3. # bashbug - create a bug report and mail it to bug-bash@prep.ai.mit.edu
  4. #
  5. # configuration section:
  6. #    these variables are filled in by the make target in cpp-Makefile
  7. #
  8. MACHINE="i386 "
  9. OS="win32 "
  10. CC="i386-cygwin32-gcc -O  -D__CYGWIN32__ "
  11. CFLAGS="  -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LIMITS_H         -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDLER -DHAVE_BCOPY -DHAVE_UID_T  -D_POSIX_VERSION -DMKFIFO_MISSING -DHAVE_STRERROR -DHAVE_STRING_H -DUSG  -DHAVE_WAIT_H         -DHAVE_DUP2 -DHAVE_STRERROR -DHAVE_DIRENT -DHAVE_DIRENT_H -DHAVE_STRING_H         -DHAVE_STRCHR -DHAVE_STRCASECMP         -Di386  -Dwin32  -DSHELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H        -O -g"
  12. RELEASE="1.14"
  13. PATCHLEVEL="6"
  14.  
  15. PATH=/bin:/usr/bin:usr/local/bin:$PATH
  16. export PATH
  17.  
  18. TEMP=/tmp/bashbug.$$
  19.  
  20. BUGADDR=${1-bug-bash@prep.ai.mit.edu}
  21.  
  22. : ${EDITOR=emacs}
  23.  
  24. trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
  25. trap 'rm -f $TEMP $TEMP.x' 0
  26.  
  27. UN=
  28. if (uname) >/dev/null 2>&1; then
  29.     UN=`uname -a`
  30. fi
  31.  
  32. if [ -f /usr/lib/sendmail ] ; then
  33.     RMAIL="/usr/lib/sendmail"
  34. elif [ -f /usr/sbin/sendmail ] ; then
  35.     RMAIL="/usr/sbin/sendmail"
  36. else
  37.     RMAIL=rmail
  38. fi
  39.  
  40. cat > $TEMP <<EOF
  41. From: ${USER}
  42. To: ${BUGADDR}
  43. Subject: [50 character or so descriptive subject here (for reference)]
  44.  
  45. Configuration Information [Automatically generated, do not change]:
  46. Machine: $MACHINE
  47. OS: $OS
  48. Compiler: $CC
  49. Compilation CFLAGS: $CFLAGS
  50. uname output: $UN
  51.  
  52. Bash Version: $RELEASE
  53. Patch Level: $PATCHLEVEL
  54.  
  55. Description:
  56.         [Detailed description of the problem, suggestion, or complaint.]
  57.  
  58. Repeat-By:
  59.         [Describe the sequence of events that causes the problem
  60.         to occur.]
  61.  
  62. Fix:
  63.         [Description of how to fix the problem.  If you don't know a
  64.         fix for the problem, don't include this section.]
  65. EOF
  66.  
  67. chmod u+w $TEMP
  68. cp $TEMP $TEMP.x
  69.  
  70. if $EDITOR $TEMP
  71. then
  72.     if cmp -s $TEMP $TEMP.x
  73.     then
  74.         echo "File not changed, no bug report submitted."
  75.         exit
  76.     fi
  77.  
  78.     ${RMAIL} $BUGADDR < $TEMP || {
  79.         cat $TEMP >> $HOME/dead.bashbug
  80.         echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2
  81.     }
  82. fi
  83.  
  84. exit 0
  85.