|nextday||Before my UNIX systems had personal , I wanted a way to make an repeat itself the next weekday (skipping Saturday and Sunday) or, sometimes, every day. Our at was simple-minded and didn't understand dates like now + 1 day. This script with two names, nextday and nextweekday, did the job. I called it from inside my at job, like this:|
On Thursday, the result will be a command like
at 2325 Friday atjob.
On Friday, the command will be
at 2325 Monday atjob; using
nextday instead, the result would be
at 2325 Saturday atjob.
The -n option returns a numeric weekday.
NOTE: This script only works with some versions of date. If your version doesn't understand format strings like
format, install the from the CD-ROM.
You can install this script from the CD-ROM or from the. If you get it from the archive, ask tar to install nextday and its other link:
nextday nextweekdayx nextday, 1564 bytes, 4 tape blocks nextweekday linked to nextday
The script tests the name it was called with, in
$0, to decide
which command to run.