How about something like:
if [ $(date -d tomorrow +%m) == $(date +%m) ] ; then
echo "Not the end of the month"
else
echo "End of the month"
fi
HTH,
your pal dave
--
Dave Thayer
Denver, Colorado USA
[EMAIL PROTECTED]
On 03-Jan-01 Nate Duehr wrote:
> Would midnight on the 1st work? Just a thought.
>
> There's no situations I can think of where the first of the month
> doesn't exist in most locales, since daylight savings changes
> officially
> at 2 AM in places that do that.
>
> (like here... grrr)
>
> On Tu
check out the GNU date function. I know that you can specify 'yesterday'
and believe that you can 'tomorrow' as well, so if tomorrow is the first,
then today is the last. Sorry, I'm on a solaris box with boring date and
it doesn't do that to my knowledge.
rick
Nate Duehr writes:
> Would midnig
Would midnight on the 1st work? Just a thought.
There's no situations I can think of where the first of the month
doesn't exist in most locales, since daylight savings changes officially
at 2 AM in places that do that.
(like here... grrr)
On Tue, Oct 17, 2000 at 06:12:21PM +0200, Jaume Teixi wr
Hi,
On Tue, 17 Oct 2000, Jaume Teixi wrote:
> I run a cron script 27-31
> then inside the script i need to check if it this last day of month
>
> how to check this ?
#!/bin/sh
MONTH=`date +%m`
DAY=`date +%d`
case "$MONTH" in
2)
DAYS=28
;;
4|6|9|11)
DAYS=30
I run a cron script 27-31
then inside the script i need to check if it this last day of month
how to check this ?
thanks,
jaume.
6 matches
Mail list logo