Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <004801c24076$c5678690$0100a8c0@home.de> From: "Bernd Strobel" To: "Andreas Wicker" Cc: References: <001b01c23d46$fd380ff0$2d32a8c0 AT mmi-pcwic DOT ids DOT de> Subject: Re: logging in via telnet: no user environment variables; cscript can't be executed Date: Sat, 10 Aug 2002 16:03:56 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 ----- 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, that > 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: USERENV=/proc/registry/HKEY_CURRENT_USER/Environment for a in $USERENV/*; do echo $a name=`basename $a` value="`sed -e 's/%\(.*\)%/\$\1/' <$a`" eval export $name=\"$value\" done 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 TEMP=/tmp TMP=/tmp 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 with > 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 suggestion. Bernd -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/