This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Fwd: getenv() in glibc
- To: libc-alpha@sourceware.cygnus.com
- Subject: Re: Fwd: getenv() in glibc
- From: John Kennedy <jk@csuchico.edu>
- Date: Fri, 10 Sep 1999 04:54:58 -0700
I think you're just being bit because just setting an environment
variable in a shell isn't enough to export it to the environment of
your child... in some of your cases, perhaps that has already been done
by a startup script or something in a profile.
warlock@akasha: uname -a
Linux akasha 2.2.12 #46 SMP Sun Aug 29 17:05:17 PDT 1999 i686 unknown
warlock@akasha: X=3D1 XX=3D2 && ./a.out
(null)
(null)
warlock@akasha: (X=3D1 XX=3D2 && ./a.out)
(null)
(null)
warlock@akasha: (export X=3D1 XX=3D2 && ./a.out)
1
2
warlock@akasha: echo $0
-bash
warlock@akasha: bash --version
GNU bash, version 2.02.1(1)-release (i686-pc-linux-gnu)
Copyright 1998 Free Software Foundation, Inc.
On Fri, Sep 10, 1999 at 12:12:08PM +0200, Franz Sirl wrote:
> Hi,
>
> I just verified Frank's report on Linux/PPC, does this happen on other
> platforms too?
>
> Franz.
>
> [fsirl@kernel:~]$ cat test.c
> #include <stdio.h>
> #include <stdlib.h>
>
> int main()
> {
> printf("%s\n", getenv("X"));
> printf("%s\n", getenv("XX"));
> return 0;
> }
> [fsirl@kernel:~]$ gcc -W -Wall -O2 test.c
> [fsirl@kernel:~]$ X=3D123 XX=3D456 ./a.out
> (null)
> 456
> [fsirl@kernel:~]$
>
>
> >Delivered-To: Franz.Sirl-kernel@lauterbach.com
> >Date: Thu, 9 Sep 1999 15:01:09 -0700 (PDT)
> >From: Frank Jas <frank@jrware.com>
> >To: Franz.Sirl-kernel@lauterbach.com
> >Subject: getenv() in glibc
> >
> >
> >I am running R5 with glibc-2.1.2 on Wallstreet II PB G3
> >
> >It seems to me that getenv() does not find one letter
> >environment variables.
> >
> >setenv() does set one letter variables though.
> >
> >Am I crazy, or is this a bug?
PGP signature