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 21:47:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.56.0405061740220.7684@slinky.cs.nyu.edu> (raw)
In-Reply-To: <409AA535.8080802@pobox.com>
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/
prev parent reply other threads:[~2004-05-06 21:41 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
2004-05-06 21:41 ` Tim Shadel
2004-05-06 21:47 ` Igor Pechtchanski [this message]
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.0405061740220.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).