environment setup problem with "env -"
Mon Jan 12 18:26:00 GMT 2004
On Mon, 12 Jan 2004, Christopher Faylor wrote:
> On Mon, Jan 12, 2004 at 12:53:32PM -0500, Igor Pechtchanski wrote:
> >On Mon, 12 Jan 2004, Joe Buehler wrote:
> >>It is apparently the case that the Cygwin DLL initializes certain
> >>environment variables when it starts up. This breaks the functionality
> >>of the "env -" command (run a program, discarding the entire current
> >>environment and using settings specified on the command line), which is
> >>expecting to be able to strictly control the environment of the command
> >>it invokes. I'm not sure what the best solution is here...
> >Hmm, looking at the sources, the only variable I can see being set by
> >the DLL is CYGWIN (if the "export" option is on). Some other variables
> >(TMP, TEMP, TMPDIR, PATH, HOME, and LD_LIBRARY_PATH) are converted to
> >the POSIX form *if they are present* in the environment. IIUC, "env -"
> >should clear the environment completely. Which variables do you see
> >being set?
> "CYGWIN" is only set if explicitly asked for, presumably in the registry.
Isn't that what I said? 0:)
> However, "TERM" will be set if it doesn't exist, ditto "HOME".
Actually, HOME will be set by the shell's rc script, AFAIK. Don't know
> We could detect the case where there is no environment and avoid setting
> "TERM" or "HOME" in that situation.
> *I'm* not going to write a patch for that, however.
There do seem to be some variables propagated from the Windows environment
(try "env - /bin/sh -c set"). I'm not sure where they're coming from,
|\ _,,,---,,_ firstname.lastname@example.org
ZZZzz /,`.-'`' -. ;-;;,_ email@example.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
More information about the Cygwin-developers