Here is a script I put together to find the last day of the month using 'cal' -useful for checks in a cron job for only the last day of the month.
#!/bin/ksh integer count=0
cal | while read A B C D E F G do ((count+=1)) if ((count>3)) ; then if [[ -z $A ]] ; then break elif [[ -z $B ]] ; then lastday=$A break elif [[ -z $C ]] ; then lastday=$B break elif [[ -z $D ]] ; then lastday=$C break elif [[ -z $E ]] ; then lastday=$D break elif [[ -z $F ]] ; then lastday=$E break elif [[ -z $G ]] ; then lastday=$F break else lastday=$G fi fi done
Here is a script I put together to find the last day of the month using 'cal' -useful for checks in a cron job for only the last day of the month.
#!/bin/ksh
integer count=0
cal | while read A B C D E F G
do
((count+=1))
if ((count>3)) ; then
if [[ -z $A ]] ; then
break
elif [[ -z $B ]] ; then
lastday=$A
break
elif [[ -z $C ]] ; then
lastday=$B
break
elif [[ -z $D ]] ; then
lastday=$C
break
elif [[ -z $E ]] ; then
lastday=$D
break
elif [[ -z $F ]] ; then
lastday=$E
break
elif [[ -z $G ]] ; then
lastday=$F
break
else
lastday=$G
fi
fi
done
print "$lastday"
exit 0
I think its a ploy...
Get rid of OpenSource etc. and then release their
own version of Linux/UNIX/whatever...
Or it could be that I've had one too much mugs of
coffee this morning.... go figure.