Niels Möller <ni...@lysator.liu.se> writes:

> E.g., if I run 
>
>   (printf foo ; sleep 30) | grep -q foo
>
> I want grep to exit successfully right away. Currently, grep waits until
> it gets EOF on the input, 30 seconds later.

Sorry if I'm confused about how to script this. The following (bash
syntax) is a better example:

  grep -q foo <(sh -c 'printf foo ; sleep 30' &)

This blocks 30 seconds before exiting. In contrast, 

  grep -q foo <(sh -c echo foo ; sleep 30' &)

(only difference is the newline at the end of the line) does exit
immediately.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.



Reply via email to