[Top][All Lists]

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

Re: Infinite loop in mdate-sh

From: Alexandre Duret-Lutz
Subject: Re: Infinite loop in mdate-sh
Date: 30 Jun 2005 15:09:12 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.3.50

>>> "Stepan" == Stepan Kasal <address@hidden> writes:

 Stepan> Two tiny comments:

 >> +Vincent Lefevre            Vincent Lefevre <address@hidden>

Oops, thanks!

 Stepan> It seems this is the first time when you repeat the full name in the 

 >> +if test "${TIME_STYLE+set}" = set; then
 >> +  TIME_STYLE=posix-long-iso
 >> +  export TIME_STYLE
 >> +fi

 Stepan> I see no reason for the `export' here.  

     The builtin `export' dubs a shell variable "environment variable".
     Each update of exported variables corresponds to an update of the
     environment variables.  Conversely, each environment variable
     received by the shell when it is launched should be imported as a
     shell variable marked as exported.

     Alas, many shells, such as Solaris 2.5, IRIX 6.3, IRIX 5.2, AIX
     4.1.5, and Digital UNIX 4.0, forget to `export' the environment
     variables they receive.  As a result, two variables coexist: the
     environment variable and the shell variable.  The following code
     demonstrates this failure:

          #! /bin/sh
          echo $FOO
          echo $FOO
          exec /bin/sh $0

     when run with `FOO=foo' in the environment, these shells will print
     alternately `foo' and `bar', although it should only print `foo'
     and then a sequence of `bar's.

     Therefore you should `export' again each environment variable that
     you update.

Alexandre Duret-Lutz

reply via email to

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