Hi,
grep can do regex search but it needs to scan each file. When the
number of files are large, it can be slow.
Is there an alternative tool that can do regex search in the indexed
files (including .docx .pdf and other commonly used file formats that
can be converted to text) so that the search
% grep --version
grep (GNU grep) 3.4
...
% echo -n > foo
% grep -v foo foo ; echo $?
1
Would expect it to exit with zero in this case, since foo is not in the
file.
When the file is one byte it works as expected:
% echo > foo
% grep -v foo foo ; echo $?
0
%
If I am reading the grep.c code correctly,
asking grep to read a zero length file,
such as:
grep foo /dev/null
causes the code to quit, with a non-zero
exit status, fairly early on, as soon as the
first call to "fillbuf()" returns with 0 bytes read.
This seems to apply except in the case of