httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: cvs commit: apache-1.3/src/support log_server_status
Date Fri, 04 Jun 1999 16:28:46 GMT

In article <E10puFd-0002kZ-00@fanf.noc.demon.net> you wrote:
> "Ralf S. Engelschall" <rse@engelschall.com> wrote:

>>For instance an excerpt from my shtool package:
>>
>>    time_year="`date '+%Y' 2>/dev/null | awk '{ printf("%s", $1); }'`"
>>    if test ".$time_year" = .; then
>>        time_year="`date '+%y' | awk '{ printf("%s", $1); }'`"
>>        case $time_year in
>>            [5-9][0-9]) time_year="19$time_year" ;;
>>            [0-4][0-9]) time_year="20$time_year" ;;
>>        esac
>>    fi
> 
> Given that time_t starts in 1970 wouldn't it be better to change that
> to this?

Yes, maybe. I currently cannot remember the correct Y2K upgrading rules.
But I remember there was somewhere a rule for <50 and >50...

>>            [7-9][0-9]) time_year="19$time_year" ;;
>>            [0-6][0-9]) time_year="20$time_year" ;;
> 
> And what's the point of the awks?

The awk's strip the newline (which cannot be done by sed, etc).  But that's
not important here (the script in Apache is a Perl script). My concern was
just that %Y definitely is not portable enough...

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message