From 66d59ef90583b8e8f241155403d184b720d0b29b Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Thu, 18 Jan 1979 17:07:57 -0500 Subject: [PATCH] Research V7 development Work on file bin/calendar Co-Authored-By: Dennis Ritchie Synthesized-from: v7 --- bin/calendar | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/calendar 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 -- 2.20.1