httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Finch <...@dotat.at>
Subject Re: cvs commit: apache-1.3/src/support log_server_status
Date Fri, 04 Jun 1999 13:43:13 GMT
"Ralf S. Engelschall" <rse@engelschall.com> wrote:
>
>Be careful, Ken: %Y is not portable.

Aaargh!

>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?

>            [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?

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net   black dog

Mime
View raw message