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