delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW |
X-Spam-Check-By: | sourceware.org |
MIME-Version: | 1.0 |
In-Reply-To: | <20120211100600.GA9823@calimero.vinschen.de> |
References: | <2BF01EB27B56CC478AD6E5A0A28931F203F560E4 AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net> <20120210150708 DOT GA22832 AT calimero DOT vinschen DOT de> <CA+sc5m=UkJRKK9WZCvcfsetSUc_CHkGC-gFZEher3Tg=fK=RkQ AT mail DOT gmail DOT com> <20120211100600 DOT GA9823 AT calimero DOT vinschen DOT de> |
Date: | Sat, 11 Feb 2012 12:19:50 -0500 |
Message-ID: | <CA+sc5mmnMBjBAqsuUdddEEwE5pgBDiGDkeV-H0WvEyZO08dMNA@mail.gmail.com> |
Subject: | Re: sed strips CRs |
From: | Earnie Boyd <earnie AT users DOT sourceforge DOT net> |
To: | cygwin AT cygwin DOT com |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id q1BHKGBJ028276 |
On Sat, Feb 11, 2012 at 5:06 AM, Corinna Vinschen wrote: > On Feb 10 14:44, Earnie Boyd wrote: >> On Fri, Feb 10, 2012 at 10:07 AM, Corinna Vinschen wrote: >> > On Feb 10 08:02, Nellis, Kenneth wrote: >> >> Cygwin 'sed' seems to be stripping CRs from its input. >> >> Linux sed doesn't do this. Example: >> > >> > Try the -b option. >> >> By this I assume you to mean that the -b option opens the input file >> in binary mode. Â But the mount table the OP showed was already in >> binary mode. Â Does sed not take that into consideration, I.E. it >> specifies the mode as a text file unless -b is specified, is this >> correct? > > Yes. Â By default files are fopened using the "rt" mode on systems > supporting this mode. Â This behaviour is hardcoded into upstream sed. But on Linux I would expect the "t" to be ignored and the file is open in "binary" mode anyway. I.E. the sed process would receive the CR for CRLF line endings. And since the OP's file systems were binary mode I would have expected it to have been the same. Except that Cygwin has created a documented exception to this for the case of binary vs text mode being explicitly specified in the call. So while it is expected behavior as defined by Cygwin it is unexpected behavior if I believe Cygwin to be similar in operation to Linux. -- Earnie -- https://sites.google.com/site/earnieboyd -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |