delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/11/07:47:07

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,TW_CG
X-Spam-Check-By: sourceware.org
Message-ID: <4D7A19AE.9020803@mentor.com>
Date: Fri, 11 Mar 2011 13:46:38 +0100
From: Philippe Scelers <philippe_scelers AT mentor DOT com>
User-Agent: Thunderbird 1.5.0.12 (X11/20081216)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: ssh from linux to windows - backtick output ended with '\r'
References: <4D790B10 DOT 4070604 AT mentor DOT com> <20110310174534 DOT GA23019 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20110310174534.GA23019@ednor.casa.cgf.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

I notice path is different between a ssh interactive session and a ssh 
remote command.
When running remote command with ssh, the path does not include path to 
cygwin
Workaround: should manually add path to cygwin at the very beginning
e.g. into a shell script:
    #!/bin/sh
    PATH="/usr/local/bin:/usr/bin:/bin:$PATH" ; export PATH
    ....

I have MKS toolkit installed on my windows machine, thinking MKS shell 
were launched instead of cygwin shell because MKS in the windows system 
path.
Perhaps a sshd server option or configuration setup to define cygwin 
shell as the default shell for remote commands?

Christopher Faylor wrote:
> On Thu, Mar 10, 2011 at 06:32:00PM +0100, Philippe Scelers wrote:
>   
>> Hi,
>> When setting a variable with the output of a command, the content of 
>> variable is not correct when passed through ssh command, but works fine 
>> within a ssh session.
>> Looks like remote interactive session with ssh enter Cygwin (uname -s = 
>> CYGWIN_NT-5.1), but remote command with ssh does not (uname -s = 
>> Windows_NT)
>>
>> And ideas would be appreciated!
>>
>> My tests, executing same command line to highlight problem
>>
>> The following remote ssh command fail ($a ends with '\r'):
>> ssh frgbuild AT win32-xp-ps 'echo "`uname -a`" ; set -x ; a=`uname -r` ; 
>> b=`uname -rs` ; echo "a=$a=EOA=" ; echo "b=$b=EOB=" ; set +x'
>> Windows_NT WIN32-XP-PS 5 01 586
>> ++ uname -r
>> + a=$'5\r'
>> ++ uname -rs
>> =EOA=
>> =EOB=dows_NT 5
>> ' b='Windows_NT 5
>> + echo $'a=5\r=EOA='
>> =EOB=' 'b=Windows_NT 5
>>     
>
> Sure looks like you're not running the Cygwin version of uname here.
> That would be consistent with \r\n line endings.
>
> cgf
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>
>   

-- 
Philippe Scelers


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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