Commit | Line | Data |
---|---|---|
170b3abf | 1 | : calendar.sh 4.4 82/11/07 |
492e9668 | 2 | PATH=/bin:/usr/bin: |
04479c21 | 3 | tmp=/tmp/cal$$ |
492e9668 BJ |
4 | trap "rm -f $tmp /tmp/cal2$$" |
5 | trap exit 1 2 13 15 | |
04479c21 BJ |
6 | /usr/lib/calendar >$tmp |
7 | case $# in | |
8 | 0) | |
f02f0c04 | 9 | trap "rm -f $tmp ; exit" 0 1 2 13 15 |
170b3abf | 10 | (/lib/cpp calendar | egrep -f $tmp);; |
04479c21 | 11 | *) |
f02f0c04 | 12 | trap "rm -f $tmp /tmp/cal2$$; exit" 0 1 2 13 15 |
04479c21 BJ |
13 | sed ' |
14 | s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ | |
15 | ' /etc/passwd \ | |
16 | | while read x | |
17 | do | |
18 | eval $x | |
492e9668 BJ |
19 | if test -r $y/calendar |
20 | then | |
170b3abf | 21 | (/lib/cpp $y/calendar | egrep -f $tmp) 2>/dev/null > /tmp/cal2$$ |
492e9668 BJ |
22 | if test -s /tmp/cal2$$ |
23 | then | |
24 | < /tmp/cal2$$ mail $z | |
25 | fi | |
04479c21 BJ |
26 | fi |
27 | done | |
28 | esac |