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

2.10.0: Cygwin now can not work well with a file in dos format.


Hi,
I've faced a problem when deal with a text file now, the old version work very well, but the new version, it wont.

1, There is a file named test.txt which in dos format(CRLF), and the content is as follows,
456467987564654654
456467987564654654
456467987564654654
456467987564654655
456467987564654656
456467987564654657
456467987564654658
456467987564654659
456467987564654660
456467987564654661
456467987564654662
456467987564654663
456467987564654664
456467987564654665

I've written a awk script named stat.awk to count each line of test.txt.
#!/bin/awk -f
BEGIN {
	list[""] = ""
	delete list
}
{
	list[$0]++
}
END {
	for(l in list)
	{
		print l ":" list[l]
	}
}

In cygwin 2.874, the output is correct.
$ ./stat.awk test.txt
456467987564654659:1
456467987564654660:1
456467987564654661:1
456467987564654662:1
456467987564654663:1
456467987564654654:3
456467987564654664:1
456467987564654655:1
456467987564654665:1
456467987564654656:1
456467987564654657:1
456467987564654658:1

But, in version 2.10.0, the output is as follows, it's not what I want.
$ ./stat.awk test.txt
:16467987564654663
:16467987564654658
:16467987564654664
:16467987564654659
:36467987564654654
456467987564654665:1
:16467987564654660
:16467987564654655
:16467987564654661
:16467987564654656
:16467987564654662
:16467987564654657

Finally, I run dos2unix to convert this file into unix format, and then run stat.awk, and this time the output is correct.
$ ./stat.awk test.txt
456467987564654659:1
456467987564654660:1
456467987564654661:1
456467987564654662:1
456467987564654663:1
456467987564654654:3
456467987564654664:1
456467987564654655:1
456467987564654665:1
456467987564654656:1
456467987564654657:1
456467987564654658:1

I was wonder, what have changed between version 2.10.0 and 2.874,  or is it possible to modify a configure to fix this in 2.10.0?

By the way, my OS is Window 7 64bit, and I installed a 64bit Cygwin with version 2.10.0 .

Thank you very much!

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


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