X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: RE: Problem with the dos2unix command Date: Fri, 19 Oct 2007 21:39:17 -0400 Message-ID: <31DDB7BE4BF41D4888D41709C476B657068AB72D@NIHCESMLBX5.nih.gov> In-Reply-To: References: From: "Buchbinder, Barry (NIH/NIAID) [E]" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l9K1dWFH021081 From: Patrick Monnerat; Sent: Wednesday, October 17, 2007 7:00 AM > 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. For the record, shouldn't the following work? sed -i -e 's/\r$//' file1, file2, ... -- 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/