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: sed strips CRs

On Feb 11 12:19, Earnie Boyd wrote:
> 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.

That's why I wrote "on systems supporting this mode".  Sed input is
text input in the first place.  Therefore it's using textmode in the
first place.  This is done so for a long time.  If it's not what you
need, there's a workaround, the -b option.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

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