gawk Has Problem With CRLF in Mixed Binary/Text Files

t.a.n.s.t.a.a.f.l@comcast.net t.a.n.s.t.a.a.f.l@comcast.net
Thu Oct 22 00:01:00 GMT 2009


Hello!

I am using a gawk script on files that contain both printing 
characters and binary data.  Gawk is used to modify a few of 
the printing characters, and I expected that the binary data 
should be left alone.  For the most part, it is, but upon 
occasion a CRLF will appear inside some of the binary data.  
All my mounts are binary (see cygcheck.srv, which is from my 
laptop), but as can be seen by the attached files, the downloaded 
gawk executable always changes CRLF to LF, while Debian Linux 
5 and a couple of flavors of Knoppix do not.

The version of gawk which first exhibited this behavior is 3.1.5, 
and both it and the cygwin1.dll are very old.  I use a later 
version of 1.5 on my laptop and desktop, but gawk on both machines 
(3.1.6 on both) does the same thing.  I tried it on my wife's 
machine at home (running 1.7 from this past February), and it 
does the same thing.  As a quick test to isolate the problem, 
I downloaded the upstream gawk 3.1.6 and compiled it on my 
laptop, and it, too, changes CRLF to LF.

Unfortunately, the time I can spend on this at work is limited, 
so once I determined that the problem lies outside gawk, I thought 
I would check the archives.  Using Gmane, I haven't come across 
anything similar yet, so I was hoping somebody here might have some 
ideas.  Anybody?

					Thx, Phil Long
 << File:  cygcheck.srv >> 
 << File:  cygwinGawk-handlesCRLF-INcorrectly.txt >> 
 << File:  genericGawkCompiledUnerCygwin-handlesCRLF-INcorrectly.txt >> 
 << File:  linuxGawk-handlesCRLF-correctly.txt >> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.srv
Type: application/octet-stream
Size: 143628 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20091022/3795a163/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwinGawk-handlesCRLF-INcorrectly.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20091022/3795a163/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: genericGawkCompiledUnerCygwin-handlesCRLF-INcorrectly.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20091022/3795a163/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linuxGawk-handlesCRLF-correctly.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20091022/3795a163/attachment-0002.txt>
-------------- next part --------------
--
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


More information about the Cygwin mailing list