On a Centos 6 machine, this works:
bash -c \'if grep -qP --line-buffered \".+\" <(tail -n 1000 -F catalina.out) ; then echo \"yes\"; fi\'
<
You should note that process substitution (<(...)
) isn't specified by POSIX. So if you were running bash
in POSIX mode by invoking it with sh
or saying:
set -o posix
then you'd observe errors!
From the bash manual:
Starting Bash with the
--posix
command-line option or executing ‘set
-o posix
’ while Bash is running will cause Bash to conform more closely to the POSIX standard by changing the behavior to match that specified by POSIX in areas where the Bash default differs....
Process substitution is not available.