From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12128 invoked by alias); 6 May 2004 20:52:07 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 12120 invoked from network); 6 May 2004 20:52:05 -0000 Received: from unknown (HELO ellimark.vpscenter.com) (206.62.135.18) by sources.redhat.com with SMTP; 6 May 2004 20:52:05 -0000 Received: from pobox.com ([159.87.128.56]) by ellimark.vpscenter.com (8.11.6/8.11.6) with ESMTP id i46KpIG03828; Thu, 6 May 2004 13:51:19 -0700 Message-ID: <409AA535.8080802@pobox.com> Date: Thu, 06 May 2004 21:41:00 -0000 From: Tim Shadel User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) MIME-Version: 1.0 To: cygwin@cygwin.com CC: Igor Pechtchanski Subject: Re: sshd, plink, bash and path problems References: <40999B63.8080305@pobox.com> <6.1.0.6.0.20040505221846.031cf5c0@127.0.0.1> <409A7C79.1000006@pobox.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00251.txt.bz2 Igor Pechtchanski wrote: >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" > Aah. I forgot about the meanings of various quotes in bash. That's an excellent example. >>>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@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. >>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. > Yup. Thanks. >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! >HTH, > Igor > > It helps immensely. Thank you very much. Tim -- 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/