This is the mail archive of the cygwin@cygwin.com 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]

awk CR/LF issue


Hi,

I've been complaining about the awk output lately.
Today I tested our old awk (3.0.3) which did what
I expected, in contrast to the new 3.1.1 awk.
So I (finally) searched the archives and found this:

"I've updated the version of GNU awk to 3.1.1-3.

This version is linked against automode.o.  It should solve CR/LF
issues on input."
http://sources.redhat.com/ml/cygwin/2002-09/msg00406.html

I don't know *what* was fixed since I cannot find a changelog
or source, and I don't know which version introduced that
bug since I only have this old 3.0.3 (I think from B20),
but it got worse for me between those versions.

Heres a test case:


[/t] $ mount
t:\bin\cygnus\home on /home type system (binmode)
t:\bin\cygnus\etc on /etc type system (binmode)
t:\bin\cygnus\lib on /usr/lib type system (textmode)
t:\bin\cygnus\lib on /lib type system (binmode)
t:\bin\cygnus\usr on /usr type system (binmode)
t:\bin\cygnus on /bin type system (binmode)
t:\bin\cygnus on /usr/bin type system (textmode)
c: on /c type system (textmode)
d: on /d type system (textmode)
e: on /e type system (textmode)
[more partitions skipped]

[Note that I have some mounts in binmode and some in text]
[Note that my awk is actually gawk]

[/t] $ echo "BEGIN { print \"123\" >> v_Out; print \"456\" >> v_Out; }" >
x.awk

[create simple awk script that outputs some lines]

[/t] $ awk --version
GNU Awk 3.0.3
[snip]
[I'm working on a cygnus 1.3.20 and only replaced the awk for this]

[/t] $ awk -v v_Out="/bin/x" -f x.awk /etc/passwd
[/t] $ notepad `cygpath -w /bin/x`

[the created file has POSIX line endings which is ok since
/bin is mounted as binmode]

[/t] $ awk -v v_Out="/c/x" -f x.awk /etc/passwd
[/t] $ notepad `cygpath -w /c/x`

[the created file has Windows CR/LF because /c is mounted
as textmode]

So the 3.0.3 GNU awk works as expected. awk 3.1.1 does not!
It outputs to POSIX style only, disregarding the mounts.

Since the old awk works as expected on this issue I'd like
to make this a bug report. Me sticks to 3.0.3 for now.

Regards,
 Harry

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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