X-Spam-Check-By: sourceware.org Date: Tue, 27 Jun 2006 14:26:33 -0600 (MDT) From: David Mastronarde To: Dave Kilroy cc: cygwin AT cygwin DOT com Subject: Re: sed 4.1.5 adds extra CR with input file path in Windows format In-Reply-To: Message-ID: References: <449EF283 DOT 80500 AT gmail DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Tue, 27 Jun 2006, Dave Kilroy wrote: > On 6/27/06, David Mastronarde wrote: >> On Sun, 25 Jun 2006, Dave wrote: >> > David Mastronarde wrote: >> >> After upgrading sed from 4.1.4 to 4.1.5, I found that line endings were >> >> being converted from CRLF to CRCRLF when the input file was specified >> >> with a windows file path: >> >> >> >> % sed -e 's/g5a/setname/g' < 'c:\cygwin\home\mast/sedtestin' > ! >> sedtestout >> >> >> >> Converting the path to cygwin format eliminated the problem. >> > >> > Have a read of http://cygwin.com/cygwin-ug-net/using-textbinary.html >> > >> > Try specifying the output file in MSDOS format, '.\sedtestout'. >> >> I don't see the distinction between the redirection and the writing, and >> also setting CYGWIN to nobinmode has no effect, so rule c does not seem to >> be relevant. > > If you set CYGWIN=nobinmode, I believe you will get newline > conversions done across pipes. In your example, you are only using > redirections. I would advise that you don't set it. > >> But also, specifying output as '.\sedtestout' did NOT solve the problem, >> even with nobinmode in effect. So rule b is governing the input but is >> not being applied on output. > > Works for me - see attached session output. > You are right. I neglected to quote the .\sedtestout when I tried it. So it all makes sense in terms of it following the rules. But I am curious as to the reason for rule b. Most things in Cygwin seem to deal interchangeably with windows and cygwin paths. David -- 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/