[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 3 May 2005 13:27:27 -0700 (PDT)
the following two commands were issued in a directory containing a
couple hundreds of subdirectories, each containing a file called
% grep ^'PATT ' */txt.txt |wc -l
% cat */txt.txt | grep ^'PATT ' | wc -l
The mistery gets solved after carefully comparing two outputs. In the
1st command, *some* files are treated as binary, hence instead of
strings grep prints a "Binary file matches..." message.
(Needless to say that all my files are equally "TEXT", with some utf-8
Would be nice to have the "Binary matching" feature documented in more
* "If the first few bytes of a file indicate that the file contains
binary data, ...."
* "By default, under MS-DOS and MS-Windows, grep guesses the file type
by looking at the contents of the first 32KB read from
don't help too much. Especially if one works under UNIX.
Do Yahoo You?
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
- grep "binary",
Vlad Kudelin <=