This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problem with the dos2unix command


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]