This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: logging in via telnet: no user environment variables; cscript can't be executed

----- Original Message -----
From: "Andreas Wicker" <>
Newsgroups: gmane.os.cygwin
Sent: Tuesday, August 06, 2002 2:44 PM
Subject: Bug: logging in via telnet: no user environment variables; cscript
can't be executed

> When I log into a computer via cygwin telnet, I do get the system
> environment variables.
> But I do not get the user environment variables.

 I use ssh but it's the same with that.

> I'd propose to build it into cygwin that you get the user user variables
> when being logged in via telnet.

That's true.

> A workaround that I've used for this consisted of a VisualBasic-Script,
> was called in the /etc/profile and that copied the
> user-environment-variables to
> a little file which then was sourced from the /etc/profile.

I found this problem interesting and since I started using cygwin extensivly
recently, I assume I will run over this problem soon.

I tried this in my /etc/profile:


for a in $USERENV/*; do
        echo $a
        name=`basename $a`
        value="`sed -e 's/%\(.*\)%/\$\1/' <$a`"
        eval export $name=\"$value\"

the sed command replaces %VARNAME% with $VARNAME. But this will only work
for the first environment variable in the value. So this probably can be
much improved, but solves the issue for TMP and TEMP. What - an the other
hand - is not needed, because the space in the pathname for these variables
will probably break some shell scripts, so I've put the following lines
after the above code


But there may be other variables which refer to %USERNAME% or %USERPROFILE%.

> This worked well with the cygwin1.dll 1.3.5, but does not work anymore
> 1.3.12. The Visual-Basic-Interpreter cscript.exe that reads the user
> einvironment
> can not be executed when logged in via telnet with cygwin1.dll 1.3.12.

Ok, I don't know any solution for this. I can only say, that it's exactly
the same bug with ssh. But maybe you don't need csript anymore if you try my


Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]