public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* sed match DOS end of line
@ 2018-01-07  0:25 Steve Harlow
  2018-01-07  2:16 ` Steven Penny
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Harlow @ 2018-01-07  0:25 UTC (permalink / raw)
  To: cygwin


Greetings,

With 'sed' (GNU sed) version 4.4 I am seeing that '$' doesn't match end 
of line with windows type text files.
It looks like something like this happened and was fixed on version 4.2.2.
https://cygwin.com/ml/cygwin/2013-06/msg00685.html

Here is the original complaint at the time.  I'm seeing the same thing 
with version 4.4.
https://cygwin.com/ml/cygwin/2013-06/msg00673.html

Do I not have some environment variable set correctly? Is this a bug in sed?

I see that I can install the older version, 4.2.2.3.  Looks like that 
might take a step backwards on some libraries too. compiler-rt(5.0.1-1), 
libc++devel (5.0.1-1), libc++1 (5.0.1-1), etc.  Is that the right way to go?

Regards,
Steve


--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sed match DOS end of line
  2018-01-07  0:25 sed match DOS end of line Steve Harlow
@ 2018-01-07  2:16 ` Steven Penny
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Penny @ 2018-01-07  2:16 UTC (permalink / raw)
  To: cygwin

On Sat, 6 Jan 2018 16:25:20, Steve Harlow wrote:
> Do I not have some environment variable set correctly? Is this a bug in sed?
> 
> I see that I can install the older version, 4.2.2.3.  Looks like that 
> might take a step backwards on some libraries too. compiler-rt(5.0.1-1), 
> libc++devel (5.0.1-1), libc++1 (5.0.1-1), etc.  Is that the right way to go?

nope - this is documented and has been discuessed at length already - past
behavior was wrong if you were on binary mount and/or pipe. current behavior is
correct for those cases:

http://cygwin.com/ml/cygwin/2017-06/msg00044.html


--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sed match DOS end of line
  2013-06-27 14:24 Paul Becker
@ 2013-06-27 14:49 ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2013-06-27 14:49 UTC (permalink / raw)
  To: cygwin

On Jun 27 13:28, Paul Becker wrote:
> > From: On Behalf Of Corinna Vinschen
> > Sent: Thursday, June 27, 2013 6:49 AM
> > Subject: [ANNOUNCEMENT] Updated: sed-4.2.2-2
> > 
> > I've just updated the Cygwin 32 and 64 bit version of sed to 4.2.2-2.
> 
> Since this 'sed' change, I noticed that "$" does not match a dos formatted file end-of-line anymore.
> 
> example:
> echo "endofline^M" | sed "s/e$/X/"
> 
> sed 4.2.1 returns
>    endoflinX
> 
> sed 4.2.2 returns
>    endofline

This seems to be an upstream change.  The Cygwin 4.2.1 and 4.2.2
releases are build the same way.  4.2.1-2 (-3 on 64 bit) and 4.2.2-1 are
both built from just the vanilla upstream sources.

While 4.2.2-2 adds the latest upstream gnulib regex, it behaves
otherwise identically to 4.2.2-1.  And both 4.2.2 releases show the same
behaviour in terms of CRLF line endings.

But it's really puzzeling.  There's no indication for this change
in the sources.


Corinna

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

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* sed match DOS end of line
@ 2013-06-27 14:24 Paul Becker
  2013-06-27 14:49 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Becker @ 2013-06-27 14:24 UTC (permalink / raw)
  To: cygwin

> From: On Behalf Of Corinna Vinschen
> Sent: Thursday, June 27, 2013 6:49 AM
> Subject: [ANNOUNCEMENT] Updated: sed-4.2.2-2
> 
> I've just updated the Cygwin 32 and 64 bit version of sed to 4.2.2-2.

Since this 'sed' change, I noticed that "$" does not match a dos formatted file end-of-line anymore.

example:
echo "endofline^M" | sed "s/e$/X/"

sed 4.2.1 returns
   endoflinX

sed 4.2.2 returns
   endofline

I don’t know if this is better or worse, or expected or not, but it is easy enough to fix my broken scripts.
Scripts will be less portable between windows and linux now unless I take this into consideration.
(and replace "$" with "^M*$")

$ echo $LC_COLLATE

$ echo $LANG
en_US.UTF-8

--
Paul




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-07  2:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-07  0:25 sed match DOS end of line Steve Harlow
2018-01-07  2:16 ` Steven Penny
  -- strict thread matches above, loose matches on Subject: below --
2013-06-27 14:24 Paul Becker
2013-06-27 14:49 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).