I'd like to execute this command:
find /apps/ -type f -print0 | grep -z log$ | xargs -0 grep 'this->aForm'
And in parallel, I'd like to see which files are being processed.
How to to this?
I'd like to execute this command:
find /apps/ -type f -print0 | grep -z log$ | xargs -0 grep 'this->aForm'
And in parallel, I'd like to see which files are being processed.
How to to this?
There is a similar question en Stack Overflow:
https://stackoverflow.com/questions/670784/redirecting-bash-stdout-stderr-to-two-places
The idea is to use named pipes, in bash you can simply do:
command_that_writes_to_stdout | tee >(command_that_reads_from_stdin)
But in the general case, use mkfifo
, for example:
mkfifo some_pipe
command_that_writes_to_stdout | tee some_pipe \
& command_that_reads_from_stdin < some_pipe
rm some_pipe
(both examples are from the Stack Overflow answer)