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 X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 6 May 2004 14:25:27 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Tim Shadel cc: cygwin AT cygwin DOT com Subject: Re: sshd, plink, bash and path problems In-Reply-To: <409A7C79.1000006@pobox.com> Message-ID: References: <40999B63 DOT 8080305 AT pobox DOT com> <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040505221846 DOT 031cf5c0 AT 127 DOT 0 DOT 0 DOT 1> <409A7C79 DOT 1000006 AT pobox DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 On Thu, 6 May 2004, Tim Shadel wrote: > I'm not subscribed to the list. Kindly CC: me in any threads that > result from this email. Thanks. > > [snip] > What I found is this: > > (a) ssh localhost echo $PATH > > returned the correct cygwin path, but > > (b) ssh localhost 'echo $PATH' > > returned the full Windows path, not the cygwin path, and > > (c) ssh localhost "echo $PATH" > > returned the correct cygwin path as well. But as I think about it, I > actually can't change the quotes used around the command (since it's > issued by a program over which I have no control). What I CAN > manipulate is the cygwin environment contacted by the ssh/plink program. > > >1. What's different between plink and plink > >(which displays a prompt) that causes the magical "login" process to > >occur. Is this a plink thing? a bash thing? a cygwin-version-of-either > >thing? It's a plink thing. FWIW, ssh behaves similarly. > Let me rephrase this a bit. What happens differently between (a) and > (b) above on the _server_ side? Why not try it locally, like this: echo echo $PATH echo 'echo $PATH' echo "echo $PATH" and then sh -xc 'PATH=/blah;echo $PATH' sh -xc "PATH=/blah;echo $PATH" > >2. Is there a file (.rc something-or-other perhaps?) that I can create > >that will make the "source /etc/profile" call once plink connects, so I > >can have the right path when happens? Well, you can tell ssh to invoke a login shell (e.g., "ssh a AT b bash -l -c 'commands'"). I don't know about plink. > Can I change the cygwin environment (server side) to handle both (a) and > (b) in the same way? No. If you run the above experiments, you'll see why. > I'm familiar with Linux, but Cygwin (and especially its interaction with > Windows: environment, permissions, etc) is brand new to me. This has nothing to do with Cygwin. This is pure shell stuff. > The quotation difference is step in the right direction (I know what to > rule out), and I'm sure with a bit more info I'll be able solve my > problem. I appreciate your help. > > Thanks, > Tim HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT 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 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/