bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unexpected behavior with TZ


From: gmail
Subject: Unexpected behavior with TZ
Date: Wed, 06 Apr 2011 00:00:41 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

Hello,

While looking after the multibyte test, i notice a behavior with printf3.sub that surprises me.

The following screen caps are a good resume :


    address@hidden $ cd bash-4.2_build

    address@hidden $ ./bash

    address@hidden $ echo $TZ

    Europe/Paris

    address@hidden $ echo $LC_ALL

    C

    address@hidden $ echo $LANG

    fr_FR

    address@hidden $ date

    Tue Apr  5 22:04:38 CEST 2011

    address@hidden $ TZ=EST5EDT

    address@hidden $ export TZ

    address@hidden $ LC_ALL=C

    address@hidden $ export LC_ALL

    address@hidden $ LANG=C

    address@hidden $ export LANG

address@hidden $ printf "%-40.50(%a %b %e %H:%M:%S %Z %Y)T date-style time\n" 1275250155

    Sun May 30 22:09:15 CEST 2010            date-style time

    address@hidden $ date

    Tue Apr  5 16:05:32 EDT 2011

address@hidden $ printf "%-40.50(%a %b %e %H:%M:%S %Z %Y)T date-style time\n" 1275250155

    Sun May 30 16:09:15 EDT 2010             date-style time



I see in the CHANGES that bash is able to detect TZ change and call tzset() if available,
i then check the build's config.log :


    address@hidden # grep -i tz config.log

    configure:13502: checking for tzset
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    | #define HAVE_TZSET 1
    ac_cv_func_tzset=yes
    #define HAVE_TZSET 1



I have probably misunderstood something, or perhaps something is wrong with my build environment or there could be a side effect when building in a chrooted jail. Or perhaps it is an expected behavior with Linux/Glibc arch ? (in all this cases, sorry for the disturbance)




Another point, i see that the tests/intl2.sub make a direct call to a
"/usr/bin/printf" command.
The intent was to see if and how bash differs from the system printf
binary (not necessarily coreutils) when changing the locale for the
duration of the command.  Bash versions before bash-4.2 had a problem
with assignments to LANG preceding builtins.  The old versions didn't
temporarily change the locale, though they performed the variable
assignment.

Chet

Not necessarily coreutils, right ^^.



Regards, C├ędric.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]