On Fri, Dec 08, 2017 at 02:36:47PM -0700, Theo de Raadt wrote:
> > root@roslunar:~# grep -m0 foo foo
> 
> It looks like it returns 0 lines of the output.
> 
> I believe -m0 should work right.  It is the kind of situation
> I expect would occur in scripts.

But it still sets the return code (which I think is wrong)
%------------------------------------------
root@roslunar:~# echo foo > foo
root@roslunar:~# grep -m0 foo foo
root@roslunar:~# echo $?
1
root@roslunar:~# grep -m5 foo foo
foo
root@roslunar:~# echo $?                                                        
0
%------------------------------------------

Reply via email to