Bug - GAWK prints wrong CR when called outside from cygwin

Markus Brandt MaBrandt@gmx.net
Fri Apr 12 05:03:00 GMT 2002


Hello,

when gawk is called outside the cygwin runtime, i.e. called from a command
prompt under Windows, and it's input is redirected to a pipe with an output of
a non-cygwin command, e.g. the Windows DIR, it does not recognize this.
As a result input conversion from "\r\n" to "\n" isn't performed an
additional "\r"s are printed.

Example:
	C:\TEMP\foo>dir
	 Datenträger in Laufwerk C: ist System
	 Volumeseriennummer: FCD8-BBF6

	 Verzeichnis von C:\TEMP\foo

	12.04.2002  12:21    <DIR>          .
	12.04.2002  12:21    <DIR>          ..
	12.04.2002  12:20                 0 bar_1
	12.04.2002  12:20                 0 bar_2
	               2 Datei(en)              0 Bytes
	               2 Verzeichnis(se),  3.320.262.656 Bytes frei

	C:\TEMP\foo>dir /b | gawk '{print $0 $0}'
	bar_1
	bar_2

==> should print bar_1bar_1 and bar_2bar_2.
==> In fact bar_1\rbar_1 and bar_2\rbar_2 are printed.
==> (Can be seen with redirection and a hex editor)

	C:\TEMP\foo>ls -1 | gawk '{print $0 $0}'
	bar_1bar_1
	bar_2bar_2

	C:\TEMP\foo>bash -c "ls -1 | gawk '{print $0 $0}'"
	bar_1bar_1
	bar_2bar_2
==> These outputs are correct.

Best regards
Markus Brandt


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



More information about the Cygwin mailing list