Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Vilmos Soti <vilmos@xxxxxxx>
- Date: 30 Aug 2006 14:39:26 -0700
"Robert M. Riches Jr." <spamtrap42@xxxxxxxxxxx> writes:
Even more, here is a way to check if this is the last day of the month:
(not checked)
month=$(date +'%h')
if ! date --date=tomorrow | grep -q " $month "; then
echo last day of the month
fi
Ensure that there is no collision with the month names anywhere.
Or, how about comparing the output of the command
date -date=tomorrow +%d
against the string "01"? Today is the last day of the month
iff tomorrow day-of-month is 1.
Your solution is even better and simpler than mine.
(but for the archive record, use --date= instead of -date=.)
Vilmos
.
- Follow-Ups:
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Robert M. Riches Jr.
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- References:
- Scheduling Jobs - Last day of the month - HOWTO?
- From: Michael B . Johnson
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Chris F.A. Johnson
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Michael B . Johnson
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Vilmos Soti
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Robert M. Riches Jr.
- Scheduling Jobs - Last day of the month - HOWTO?
- Prev by Date: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Next by Date: Re: Some bash questions :-)
- Previous by thread: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Next by thread: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Index(es):
Relevant Pages
|