source: trunk/athena/bin/sendbug/sendbug.sh @ 5381

Revision 5381, 2.1 KB checked in by epeisach, 33 years ago (diff)
No longer use sh_path
Line 
1#!/bin/sh
2# $Id: sendbug.sh,v 1.5 1991-07-22 17:00:09 epeisach Exp $
3# make sure stuff this script needs is up front
4PATH=/srvd/patch:/usr/athena/bin:/bin/athena:/usr/bin/X11:/usr/ucb:/bin:/usr/bin
5bugs_address=bugs@Athena.MIT.EDU
6sendmail="/usr/lib/sendmail -t -oi"
7report_file=/tmp/bug$$.text
8version_file=/etc/version
9if [ ! -r $version_file ]; then
10        version="unknown version (no $version_file found)"
11else
12        awk_cmd='\
13                {if ($5 == "Update") update++; \
14                else if ($5 == version) { same++; update=0; } \
15                else { version=$5; update=0; same=0; } } \
16        END { printf "%s", version; \
17                close=0; \
18                if (update) { printf " (plus partial update"; close=1; }\
19                else if (same) { \
20                        if (close) printf "; "; \
21                        else printf " ("; \
22                        printf "%d update(s) to same version", same; \
23                        close=1; } \
24                if (close) printf ")"; \
25        }'
26        version=`awk "$awk_cmd" < $version_file`
27fi
28short_version=`expr "$version (" : '\([^(]*[^( ]\) *(.*'`
29machtype=`machtype`
30cpu=`machtype -c`
31hostname=`hostname`
32dpy=`machtype -d`
33/usr/ucb/fmt << EOF
34Please enter the subject for this bug report.  (Generally, this means the
35name of the program or locker with which you are having problems.)
36EOF
37echo -n ' --> '
38read subject
39cat > $report_file << EOF
40To: $bugs_address
41Subject: $machtype $short_version: $subject
42-------
43System name:            $hostname
44Type and version:       $cpu $version
45Display type:           $dpy
46
47What were you trying to do?
48        [Please replace this line with your information.]
49
50What's wrong:
51        [Please replace this line with your information.]
52
53What should have happened:
54        [Please replace this line with your information.]
55
56Please describe any relevant documentation references:
57        [Please replace this line with your information.]
58EOF
59
60fmt << EOF
61
62Please fill in the specified fields of the bug report form, which will
63be displayed momentarily.
64Remember to save the file before exiting the editor.
65EOF
66
67if [ -r $HOME/.mh_profile ]; then
68        comp -form $report_file
69        rm $report_file
70        exit 0
71fi
72# not using MH; run the editor, and send, ourselves.
73if [ "x$EDITOR" = "x" ]; then
74        EDITOR=/usr/athena/emacs ; export EDITOR
75fi
76
77$EDITOR $report_file
78exec whatnow $report_file
Note: See TracBrowser for help on using the repository browser.