Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Bug in QNX4 grep?: Page 1 of 8 (8 Items)
   
Bug in QNX4 grep?  
I'm trying to build a package on QNX4 using the configure script built with autoconf 2.65 but it fails. I've tracked it 
down to what appears to be a bug in the QNX supplied grep.

The command that is failing is effectively:

grep -c '$'

This is supposed to count the number of end-of-lines in the input stream but always returns 0.

An example of usage:

cat /etc/hosts | grep -c '$'

will return 0 on QNX4, but works fine on Linux.

cat /etc/hosts | grep -c '^'

successfully returns the number of start-of-lines on QNX4 and Linux, so I conclude that there is a bug in the supplied 
grep.

As the use of grep -c '$' is embedded in the generated configure script I can change the configure script but that's not
 an ideal solution. It will affect every other source package distributed that uses autoconf, not just the ones that I 
maintain.

Is there any chance that this bug in grep could be rectified? (This is the most effective solution)
Is there a port of GNU grep for QNX4? (This is also not ideal as it would require installation of another package)
I will try and see if the autoconf maintainers will make a change to work around this bug.

Thanks for reading this far.
Mark