delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/06/15:26:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Tim Shadel <timshadel AT pobox DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: sshd, plink, bash and path problems
In-Reply-To: <409A7C79.1000006@pobox.com>
Message-ID: <Pine.GSO.4.56.0405061404430.7684@slinky.cs.nyu.edu>
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
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 <host> <command> and plink <host>
> >(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 <command> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019