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

Revision 2433, 2.0 KB checked in by raeburn, 35 years ago (diff)
New version, including info from `machtype' program, release number, &c.
Line 
1#!/bin/sh
2# $Id: sendbug.sh,v 1.3 1989-12-04 15:22:54 raeburn Exp $
3# make sure stuff this script needs is up front
4eval `/etc/athena/sh_commands_path`
5PATH=$PATH:/bin/athena
6bugs_address=bugs@Athena.MIT.EDU
7sendmail="/usr/lib/sendmail -t -oi"
8report_file=/tmp/bug$$.text
9version_file=/etc/version
10if [ ! -r $version_file ]; then
11        version="unknown version (no $version_file found)"
12else
13        awk_cmd='\
14                {if ($5 == "Update") update++; \
15                else if ($5 == version) { same++; update=0; } \
16                else { version=$5; update=0; same=0; } } \
17        END { printf "%s", version; \
18                close=0; \
19                if (update) { printf " (plus partial update"; close=1; }\
20                else if (same) { \
21                        if (close) printf "; "; \
22                        else printf " ("; \
23                        printf "%d update(s) to same version", same; \
24                        close=1; } \
25                if (close) printf ")"; \
26        }'
27        version=`awk "$awk_cmd" < $version_file`
28fi
29short_version=`expr "$version (" : '\([^(]*[^( ]\) *(.*'`
30machtype=`machtype`
31cpu=`machtype -c`
32hostname=`hostname`
33dpy=`machtype -d`
34/usr/ucb/fmt << EOF
35Please enter the subject for this bug report.  (Generally, this means the
36name of the program or locker with which you are having problems.)
37EOF
38echo -n ' --> '
39read subject
40cat > $report_file << EOF
41To: $bugs_address
42Subject: $machtype $short_version: $subject
43-------
44System name:            $hostname
45Type and version:       $cpu $version
46Display type:           $dpy
47What were you trying to do?
48        [Please fill this in.]
49
50What's wrong:
51        [Please fill this in.]
52
53What should have happened:
54        [Please fill this in.]
55
56Please describe any relevant documentation references:
57        [Please fill this in.]
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.