-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_beer
executable file
·51 lines (39 loc) · 1011 Bytes
/
send_beer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
#
# send_beer - very ordinary beer submission
#
# Create a beer submission report and mail to `[email protected]'
# The sender will be placed in `vi' with a copy of the beer submission
# template. When complete, simply exit the editor, and the report will be
# mailed automatically.
#
#
mailer=/usr/ucb/mail
ed=/usr/ucb/vi
tool=`basename $0`
vobs=/tmp/$tool.$$
vobsb=${vobs}b
trap "rm -f $vobs $vobsb; exit" 0 1 2 3 15
sed -e "1,/^#SEND_BEER_FORMAT/d" < $0 > $vobs
cp $vobs $vobsb
$ed $vobs
cmp -s $vobs $vobsb
if (test $? -eq 0 -o `cat $vobs | wc -c` -le 1) then
echo "$tool: cancelled"
else
$mailer $ericmail <$vobs
echo "$tool: sent"
fi
exit 0
#SEND_BEER_FORMAT
Dear Eric,
I thank you kindly for your free software and hope that you continue
to produce work of this kind. To support you I am sending you
<ENTER QUANTITY> cans of <ENTER BRAND>.
Best Regards,
<ENTER NAME>,
<ENTER COMPANY>,
<ENTER CONTACT>,
<ENTER ADDRESS>,
<ENTER PHONE>