On Mon, Nov 16, 2015 at 05:04:24PM -0800, Stefan Beller wrote:
> >> This is true for the gnu version of grep. I am not sure if all
> >> versions of grep support this optimization. In case it is not,
> >> we'd revert this patch.
> >
> > POSIX specifies -q, so you should be fine.
> >
Instead of redirecting all grep output to /dev/null, we can just
pass in -q instead. This preserves the exit code behavior, but is faster.
As grep returns true if it finds at least one match, grep can exit promptly
after finding the first line and doesn't need to find more occurrences
which would
On Mon, Nov 16, 2015 at 10:43 PM, Stefan Beller wrote:
> Instead of redirecting all grep output to /dev/null, we can just
> pass in -q instead. This preserves the exit code behavior, but is faster.
> As grep returns true if it finds at least one match, grep can exit promptly
>
+cc Andrey Rybak, who I credit for finding the reasoning below (he
sent to me privately,
without cc'ing the list)
On Mon, Nov 16, 2015 at 4:59 PM, Mikael Magnusson wrote:
> On Mon, Nov 16, 2015 at 10:43 PM, Stefan Beller wrote:
>> Instead of redirecting
4 matches
Mail list logo