Fred . wrote:
# 2.3 mb
fgrep --recursive "//" * > comments-1.txt

# 3.8 mb
fgrep -h --recursive "//" * > comments-2.txt

$ wc -l comments-1.txt
30123 comments-1.txt

$ wc -l comments-2.txt
61708 comments-2.txt

I did this on the Linux kernel source.
Why does the -h parameter make it spit out over twice as many lines?

For the first 5845 lines it works correctly. After that it starts
spitting the lines with filenames.
arch/s390/appldata/appldata.h:11://#define APPLDATA_DEBUG                       
/* Debug
messages on/off */
arch/cris/arch-v10/kernel/time.c:200://static unsigned short myjiff;
/* used by our debug routine print_timestamp */
arch/parisc/kernel/real2.S:280: /*
http://lists.parisc-linux.org/hypermail/parisc-linux/10916.html

Then it stops at line 37430 with the filenames and resumes to printing
lines without the filenames until end of file.

Not sure if this is a bug, or me being stupid.

Hi Fred.

Thanks for your report. What version of grep are you using and on which system/distribution?

Can you try it with the latest version from ftp://alpha.gnu.org/gnu/grep and let us know if the problem persists?

Cheers,

TAA

--
Tony Abou-Assaleh
Email:    [EMAIL PROTECTED]
Web site: http://tony.abou-assaleh.net


Reply via email to