On Fri, Dec 08, 2017 at 02:40:54PM -0700, Theo de Raadt wrote: > > 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 > > %------------------------------------------ > > Why do you think it is wrong? > > EXIT STATUS > The grep utility exits with one of the following values: > > 0 One or more lines were selected. > 1 No lines were selected. > > With -m 0, no lines were selected. So error 1.
Ugh, sorry. My bad. It is correct.
