# Copyright (c) 1988 Regents of the University of California.
# All rights reserved. The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
# @(#)calendar.sh 4.7 (Berkeley) %G%
PATH
=/usr
/lib
:/bin
:/usr
/bin
:/usr
/ucb
:/lib
# order important
trap "rm -f $tmp /tmp/cal1$$ /tmp/cal2$$"
trap "rm -f $tmp ; exit" 0 1 2 13 15
(cpp calendar |
egrep -f $tmp)
if [ $# = 1 ] && [ $1 = "-" ]; then
trap "rm -f $tmp /tmp/cal1$$ /tmp/cal2$$; exit" 0 1 2 13 15
echo -n "Subject: Calendar for " > /tmp
/cal1$$
date |
sed -e "s/ [0-9]*:.*//" >> /tmp
/cal1$$
s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/
(cpp
$y/calendar |
egrep -f $tmp) 2>/dev
/null
> /tmp
/cal2$$
cat /tmp
/cal1$$
/tmp
/cal2$$ |
mail $z
echo "usage: calendar [-]"