X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <4716E9E2.9030509@cwilson.fastmail.fm> Date: Thu, 18 Oct 2007 01:06:42 -0400 From: Charles Wilson User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Problem with the dos2unix command References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Patrick Monnerat wrote: > I'm trying to convert a \r\n line-ending file to unix style, but > this file has some lines with their last character being \r (i.e.: the > sequence of binary bytes is ...\r\r\n...) > > Using dos2unix to convert it strips both \r, resulting in a byte > sequence ...\n... > > This seems to me a bug. I need the trailing \r in the file as a normal > character, not being part of the line ending. This behavior is by design. What you ask doesn't make much sense for most text processing: before: abcd\r\r\n <<--- look, a DOS line ending '\r\n'. after running it through YOUR desired dos2unix: abcd\r\n <<--- look, it STILL has a DOS line ending! If dos2unix worked that way, FAR more people would be annoyed: "I ran my file 'foo' thru dos2unix, but it still has dos line endings!" If someone were to submit a patch to add an optional, "non-greedy" mode to dos2unix it would be thoughtfully considered... -- Chuck -- 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/