Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with script which reminds ppl its Friday the 13th

Status
Not open for further replies.

kim808

IS-IT--Management
Nov 12, 2002
2
US
If anyone could help, it would be much appreciated. For fun, I'm trying to create a script in KORN shell that reminds people that it's Friday the 13th. I want to put this in the crontab file so as to execute the script. Also, how would I use the banner command to display the date.

Thanks much in advance for any replies
 
Kim808:

This should get you started. I haven't tested it from cron. I'd make sure PATH
was set in the script.

Regards,

Ed

#!/bin/ksh

set `date`
# set command sets the command line arguments as such:
# $1 $2 $3 $4 $5 $6
# Tue Nov 12 23:39:32 PST 2002
if [[ $1 == "Fri" && $3 = 13 ]]
then
# banner the date MM DD YYYY
banner $2 $3 $6
fi
 
i'm not really shure ( ==> it must be checked )
parameters in the crontab :

"minute hour" "number of the day" "number of the month" "number of the week" "script name"

to start at friday 13 08:00 my script

00 08 13 * 5 my script

 
Code:
0 12 13 * 5 mailx `/usr/usb/whoami` -s &quot;it's midday friday the 13th&quot; < /dev/null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top