Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 6 May 2004 17:41:57 -0400 (EDT)
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
Reply-To: cygwin@cygwin.com
To: Tim Shadel <timshadel@pobox.com>
cc: cygwin@cygwin.com
Subject: Re: sshd, plink, bash and path problems
In-Reply-To: <409AA535.8080802@pobox.com>
Message-ID: <Pine.GSO.4.56.0405061740220.7684@slinky.cs.nyu.edu>
References: <40999B63.8080305@pobox.com> <6.1.0.6.0.20040505221846.031cf5c0@127.0.0.1> <409A7C79.1000006@pobox.com> <Pine.GSO.4.56.0405061404430.7684@slinky.cs.nyu.edu> <409AA535.8080802@pobox.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:

> Igor Pechtchanski wrote:
>
> [snip]
> >>>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.
>
> plink also allows commands to be run.  That "bash -l -c 'commands'"
> works great.  I see if there's any way to change the code to use it, but
> that solves my problem.
>
> [snip]
> >This has nothing to do with Cygwin.  This is pure shell stuff.
>
> I guess I didn't know the original PATH was the windows one.  That makes
> more sense now.  So I'd see the same thing on a Linux box using pure
> ssh.  If the PATH were changed by /etc/profile, and I didn't use the
> "bash -l -c 'commands'" stuff to force a bash login, then I wouldn't see
> the new PATH there either.
>
> I assume that the only way to 'source /etc/profile' requires a change to
> the content after "ssh a@b".  For example, '"ssh a@b bash -l -c
> 'commands'" and "ssh a@b source /etc/profile; commands" both work for
> me.  I only wish I could "ssh a@b commands" and have it work.  I've got
> the info I need to figure out a different solution, though.  Thanks!

If you set up your variables in ~/.bashrc instead of /etc/profile, that
should get executed on every bash invocation (assuming your remote shell
is "bash").
	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/

