Red Hat Bugzilla – Bug 192579
named pipe vs "grep -sr"
Last modified: 2007-11-30 17:11:33 EST
Description of problem:
A named pipe interferes with the use of "grep -sr <term> <directory>" to search
an entire directory tree in a reliable way.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. mkdir dir1
2. cd dir1; mkfifo fifo
3. cd ..; grep -sr foo . &
4. strace -p <pid-of-grep-above>
$ strace -p 3044
Process 3044 attached - interrupt to quit
## This shows that grep is blocked waiting for the fifo.
Under flags "-sr", grep should not wait for fifos. Grep should ignore an empty
fifo entirely; and read a non-empty fifo with non-blocking I/O, and assume
End-of-File as soon as the read() returns 0 or -1. Or, there should be another
command-line flag to specify the behavior "don't wait for fifos", so that there
is some reliable way to search a directory tree for strings.
In theory, '-D skip' is the option you want. In practice, it's broken. :-/
*** This bug has been marked as a duplicate of 189580 ***