From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11190 invoked by alias); 3 Sep 2003 20:34:20 -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 11181 invoked from network); 3 Sep 2003 20:34:19 -0000 Received: from unknown (HELO tomts25-srv.bellnexxia.net) (209.226.175.188) by sources.redhat.com with SMTP; 3 Sep 2003 20:34:19 -0000 Received: from docbill002 ([65.93.186.182]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030903203418.SJWR9720.tomts25-srv.bellnexxia.net@docbill002>; Wed, 3 Sep 2003 16:34:18 -0400 Message-ID: <053001c3725a$bfe9cea0$c900000a@docbill002> From: "Bill C. Riemers" To: "Garrison, Jim" , References: <732AC39DA54C1C4FBCBCC2F853D3AB816D16F9@athensgroup-pc9.athensgroup.com> Subject: Re: Strange cygpath/Perl 5.8 interaction? Date: Wed, 03 Sep 2003 20:34:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-SW-Source: 2003-09/txt/msg00239.txt.bz2 It is not perl adding and extra line feed. It is bash automatically removing a line feed... i.e. $ echo "|"`pwd`"|" |/tmp| $ pwd |od -t x1 0000000 2f 74 6d 70 0a 0000005 Bash will remove the \n for you automatically when using `pwd`, perl won't. To tell perl to remove the trailing "\n" use the chomp function. $ perl -e 'chomp($a=`pwd`);print "|".$a."|\n";' |/tmp| ----- Original Message ----- From: "Garrison, Jim" To: Sent: Wednesday, September 03, 2003 4:13 PM Subject: Strange cygpath/Perl 5.8 interaction? > In bash: > > $ echo "\"`cygpath -w /c/temp`\"" > "c:\temp" > > > But in Perl: > > $a = `cygpath -w /c/temp`; > print "|$a|"; > > produces > > |c:\temp > | > > I.e., Perl sees an extra \n at the end of the string. I looked at > the source for cygpath and it doesn't seem to be adding a \n, so > I suspect the problem is an unforeseen interaction between Cygwin > and Perl's backtick operator. Can anyone shed light on this topic? > > Jim Garrison > jhg@athensgroup.com > > -- > 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/ > -- 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/