:
: Used as a filter on the output from a super user unbook
: Sends mail to all people unbooked including an {optional} explanation
:
cat > /tmp/tbsmail$$
if test ! -s /tmp/tbsmail$$
then echo 'EOF?'
else
cat <<! ^ ed - /tmp/tbsmail$$
gp
1d
,s/ user \([^ ]*\) \(.*\)/cat <<~ ^ mail \1\\
$*\\
You have had the following terminal booking unbooked by TBS:\\
\2\\
The cost of the booking has been refunded to your account.\\
~/
g/^\$/d
w
!
sh /tmp/tbsmail$$
fi
rm /tmp/tbsmail$$
