I am using BB 1.29.2 on Android and recently encountered a situation when a recursive grep command was hanging. I discovered that in the folder/file tree being recursed there were several files which ls -l shows having a file type of "p", named pipe.
I can understand why this might cause a problem. But it seems that it might be a good idea for grep to check the file type and not even attempt to open/process such files. One would think that this would at least create a file open/read error given that there is the -s option for suppressing output of this nature. But all I get is a hung grep that must be manually killed.
I know how to avoid this using something like this:
find . -type f -exec grep pattern {}
But this seems far less efficient than having grep the files it intends to try and open.
Thanks very much!
I am using BB 1.29.2 on Android and recently encountered a situation when a recursive grep command was hanging. I discovered that in the folder/file tree being recursed there were several files which ls -l shows having a file type of "p", named pipe. I can understand why this might cause a problem. But it seems that it might be a good idea for grep to check the file type and not even attempt to open/process such files. One would think that this would at least create a file open/read error given that there is the -s option for suppressing output of this nature. But all I get is a hung grep that must be manually killed. I know how to avoid this using something like this: find . -type f -exec grep pattern {} But this seems far less efficient than having grep the files it intends to try and open. Thanks very much!