public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problems opening pipes in binary mode
@ 2017-03-05 16:03 Dr Rainer Woitok
  2017-03-05 17:04 ` Brian Inglis
  0 siblings, 1 reply; 2+ messages in thread
From: Dr Rainer Woitok @ 2017-03-05 16:03 UTC (permalink / raw)
  To: cygwin

Greetings,

after some discussion the packages "awk", "grep", and "sed" were recent-
ly updated to open pipes  in binary mode only.   I do not want to revive
the discussion about pros and cons,  I just want to make known  how this
change broke one of my scripts.  My script contains the line

   cygcheck -cv | gawk '...'

which now produces  utterly garbled output.   The reason  simply is that
"cygcheck" produces output lines with Windows style line ends.   To test
just run the following:

   $ cygcheck -cv | od -tcx1 | head -4
   0000000   C   y   g   w   i   n       P   a   c   k   a   g   e       I
            43  79  67  77  69  6e  20  50  61  63  6b  61  67  65  20  49
   0000020   n   f   o   r   m   a   t   i   o   n  \r  \n   L   a   s   t
            6e  66  6f  72  6d  61  74  69  6f  6e  0d  0a  4c  61  73  74

So there obviously is at least one Cygwin tool  which uses Windows style
"\r\n" line ends  in its output.   I don't know whether or not there are
any others,  but in my opinion this move to binary mode pipes should not
have been made as long as there are Cygwin tools producing Windows style
line ends.

Sincerely,
  Rainer

--
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] 2+ messages in thread

* Re: Problems opening pipes in binary mode
  2017-03-05 16:03 Problems opening pipes in binary mode Dr Rainer Woitok
@ 2017-03-05 17:04 ` Brian Inglis
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Inglis @ 2017-03-05 17:04 UTC (permalink / raw)
  To: cygwin

On 2017-03-05 09:03, Dr Rainer Woitok wrote:
> after some discussion the packages "awk", "grep", and "sed" were recent-
> ly updated to open pipes  in binary mode only.   I do not want to revive
> the discussion about pros and cons,  I just want to make known  how this
> change broke one of my scripts.  My script contains the line
>    cygcheck -cv | gawk '...'
> which now produces  utterly garbled output.   The reason  simply is that
> "cygcheck" produces output lines with Windows style line ends.   To test
> just run the following:
>    $ cygcheck -cv | od -tcx1 | head -4
>    0000000   C   y   g   w   i   n       P   a   c   k   a   g   e       I
>             43  79  67  77  69  6e  20  50  61  63  6b  61  67  65  20  49
>    0000020   n   f   o   r   m   a   t   i   o   n  \r  \n   L   a   s   t
>             6e  66  6f  72  6d  61  74  69  6f  6e  0d  0a  4c  61  73  74
> So there obviously is at least one Cygwin tool  which uses Windows style
> "\r\n" line ends  in its output.   I don't know whether or not there are
> any others,  but in my opinion this move to binary mode pipes should not
> have been made as long as there are Cygwin tools producing Windows style
> line ends.

Patched in: 

https://sourceware.org/ml/cygwin-cvs/2017-q1/msg00039.html

should be picked up in next releases of cygcheck and strace in package cygwin.
This has not been mentioned in cygwin-patches, cygwin-apps, or here in cygwin.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
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] 2+ messages in thread

end of thread, other threads:[~2017-03-05 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-05 16:03 Problems opening pipes in binary mode Dr Rainer Woitok
2017-03-05 17:04 ` Brian Inglis

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