Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!umcp-cs!chris
From: chris@umcp-cs.UUCP (Chris Torek)
Newsgroups: net.sources
Subject: Re: Cute (.login || .profile) program
Message-ID: <2440@umcp-cs.UUCP>
Date: Fri, 11-Jan-85 18:56:34 EST
Article-I.D.: umcp-cs.2440
Posted: Fri Jan 11 18:56:34 1985
Date-Received: Sun, 13-Jan-85 08:23:59 EST
References: <342@men1.UUCP>
Distribution: net
Organization: U of Maryland, Computer Science Dept., College Park, MD
Lines: 41

Gee, we force this one on everyone here!  We have in /usr/lib/crontab
the line

	2 0,6,12,18 * * * /usr/local/etc/motd_ed

with the motd_ed script reading:

	#! /bin/csh -f
	set file=/tmp/med_$$
	cat <<'fin' >$file
	g/Good morning!/d
	g/Good afternoon!/d
	g/Good evening!/d
	g/What are you doing on at this time of night?/d
	$-1a
	'fin'
	set time=`date | awk '{printf $4}' | awk -F: '{print $1}'`
	if ($time < 6) then
		echo 'What are you doing on at this time of night?' >>$file
	else if ($time < 12) then
		echo 'Good morning\!' >>$file
	else if ($time < 18) then
		echo 'Good afternoon\!' >>$file
	else
		echo 'Good evening\!' >>$file
	endif
	cat <<'fin' >>$file
	.
	w
	q
	'fin'
	ex - /etc/motd <$file
	rm $file

(We also have /etc/rc.local invoke this to fix the motd when rebooting.)
-- 
(This line accidently left nonblank.)

In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland