X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0	tests=AWL,BAYES_00,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o-
Date: Thu, 10 Mar 2011 12:45:34 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: ssh from linux to windows - backtick output ended with '\r'
Message-ID: <20110310174534.GA23019@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4D790B10.4070604@mentor.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4D790B10.4070604@mentor.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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

