Re: Scheduling Jobs - Last day of the month - HOWTO?



"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
.



Relevant Pages

  • Re: Scheduling Jobs - Last day of the month - HOWTO?
    ... echo last day of the month ... Ensure that there is no collision with the month names anywhere. ... how about comparing the output of the command ... Robert Riches ...
    (comp.os.linux.misc)
  • Re: CERN concern
    ... cosmic ray does is like comparing an atom bomb with a single uranium atom. ... Any given proton will collide with at most one other ... collision is totally independent of any other collision. ...
    (sci.math)
  • Re: echo all the time vs echo at the end - what is faster
    ... >> echo all the time vs echo at the end - what is faster ... > As everyone stated, comparing the two, is faster. ... > for outputting large blocks of text, dropping out of PHP parsing mode ... While speed is important to me, efficient code is probably even more ...
    (comp.lang.php)
  • Re: How to debug PHPs mysql_query() function?
    ... >Have you tried getting the function to echo the query string that it ... and comparing that to what you expect? ... Warning: mysql_infoexpects parameter 1 to be resource, ...
    (comp.lang.php)
  • Re: Why all hash algorithm are hexadecimal in PHP?
    ... echo 'sha256=>' .hash('sha256', 'The quick brown fox jumped over the ... So with only 11 caracteres I can have much more combination and much ... So how can I create a hash algorithm like youtube? ... The chances of a collision with md5 and the rest are VERY remote. ...
    (comp.lang.php)