environment setup problem with "env -"

Igor Pechtchanski pechtcha@cs.nyu.edu
Mon Jan 12 19:24:00 GMT 2004


On Mon, 12 Jan 2004, Christopher Faylor wrote:

> On Mon, Jan 12, 2004 at 01:26:04PM -0500, Igor Pechtchanski wrote:
> >On Mon, 12 Jan 2004, Christopher Faylor wrote:
> >>On Mon, Jan 12, 2004 at 12:53:32PM -0500, Igor Pechtchanski wrote:
> >>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
> >about TERM.
>
> HOME will be set by the CYGWIN DLL itself, as will TERM.

Yes, you're absolutely right, my bad.  Sorry for the noise.

> >>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, though.
>
> IIRC, some environment variables are actually required for correct
> operation.  TERM and HOME are not among them, however.
>
> env - env
>
> would be a better test than using /bin/sh, btw.  My cygwin is busted
> right now so I can't actually test this.
>
> cgf

FWIW, here's what I get on my machine:

$ env - /bin/env
HOMEDRIVE=C:
HOMEPATH=\
LOGONSERVER=\\PECHTCHA
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
USERDOMAIN=PECHTCHA
USERNAME=igor
USERPROFILE=C:\Documents and Settings\igor
$

Using "/bin/sh -c set" adds IFS, PATH, PS1, and PS2.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.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 mailing list