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

Revision 2447, 2.1 KB checked in by epeisach, 35 years ago (diff)
Better wording and spacing
Line 
1#!/bin/sh
2# $Id: sendbug.sh,v 1.4 1989-12-08 12:49:52 epeisach 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
47
48What were you trying to do?
49        [Please replace this line with your information.]
50
51What's wrong:
52        [Please replace this line with your information.]
53
54What should have happened:
55        [Please replace this line with your information.]
56
57Please describe any relevant documentation references:
58        [Please replace this line with your information.]
59EOF
60
61fmt << EOF
62
63Please fill in the specified fields of the bug report form, which will
64be displayed momentarily.
65Remember to save the file before exiting the editor.
66EOF
67
68if [ -r $HOME/.mh_profile ]; then
69        comp -form $report_file
70        rm $report_file
71        exit 0
72fi
73# not using MH; run the editor, and send, ourselves.
74if [ "x$EDITOR" = "x" ]; then
75        EDITOR=/usr/athena/emacs ; export EDITOR
76fi
77
78$EDITOR $report_file
79exec whatnow $report_file
Note: See TracBrowser for help on using the repository browser.