Is that possible to use grep
on a continuous stream?
What I mean is sort of a tail -f
command, but with grep
on t
sed would be a better choice (stream editor)
tail -n0 -f
and then if you wanted the tail command to exit once you found a particular string:
tail --pid=$(($BASHPID+1)) -n0 -f
Obviously a bashism: $BASHPID will be the process id of the tail command. The sed command is next after tail in the pipe, so the sed process id will be $BASHPID+1.