public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
To: Tim Shadel <timshadel@pobox.com>
Cc: cygwin@cygwin.com
Subject: Re: sshd, plink, bash and path problems
Date: Thu, 06 May 2004 19:03:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.56.0405061404430.7684@slinky.cs.nyu.edu> (raw)
In-Reply-To: <409A7C79.1000006@pobox.com>

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@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@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

--
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/

  reply	other threads:[~2004-05-06 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06  1:57 Tim Shadel
2004-05-06  2:26 ` Larry Hall
2004-05-06 18:01   ` Tim Shadel
2004-05-06 19:03     ` Igor Pechtchanski [this message]
2004-05-06 21:41       ` Tim Shadel
2004-05-06 21:47         ` Igor Pechtchanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.56.0405061404430.7684@slinky.cs.nyu.edu \
    --to=pechtcha@cs.nyu.edu \
    --cc=cygwin@cygwin.com \
    --cc=timshadel@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).