Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Strange grep behavior
@ 2003-11-10 15:02 Helge Preuss
  2003-11-10 18:01 ` Adam Price
  0 siblings, 1 reply; 2+ messages in thread
From: Helge Preuss @ 2003-11-10 15:02 UTC (permalink / raw)


Hi,
a colleague of mine complained to me that grep does not print lines 
matching the search expression in some of his files, giving the message 
"binary file foo.txt matches". Now his files are just plain old text 
files. What is even stranger, if he renames that file, grep prints the 
matching lines.
Now I was not able to reproduce this behavior, but I found a different 
unexpected behavior: grepping for a string in a binary file, which i 
know it exists, two times out of three (different strings) it does not 
find the search string. The third time, it just prints the string. No 
line number, no mention of a binary file eiteher.
So my questions: Is this behavior known, maybe even documented? More 
generally, how does grep determine whether a file is a binary?
The OS in case is Tru64 5.1a.
TIA
Helge

-- 
hint: my first name is not "spam"!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-10 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-10 15:02 Strange grep behavior Helge Preuss
2003-11-10 18:01 ` Adam Price

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox