From: Ken Thompson Date: Thu, 18 Jan 1979 22:07:57 +0000 (-0500) Subject: Research V7 development X-Git-Tag: Bell-32V^2~170 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/66d59ef90583b8e8f241155403d184b720d0b29b?hp=d0048c39c21f7e468b1a055c4621b10ac60bc8ee Research V7 development Work on file bin/calendar Co-Authored-By: Dennis Ritchie Synthesized-from: v7 --- diff --git a/bin/calendar b/bin/calendar new file mode 100755 index 0000000000..d534f02396 --- /dev/null +++ b/bin/calendar @@ -0,0 +1,19 @@ +PATH=/bin:/usr/bin +tmp=/tmp/cal$$ +trap "rm $tmp; exit" 0 1 2 13 15 +/usr/lib/calendar >$tmp +case $1 in +-) + sed ' + s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ + ' /etc/passwd \ + | while read x + do + eval $x + if test -r $y/calendar; then + egrep -f $tmp $y/calendar 2>/dev/null | mail $z + fi + done;; +*) + egrep -f $tmp calendar +esac