Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as off-topic by voretaq7 Jul 10 '13 at 15:25

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

@oliver While it's not a bad question I'm going to close this as off-topic as it really doesn't directly deal with system administration (general scripting questions are more appropriate on Unix & Linux). If you'd like to try for more answers I can migrate this, but it's useful here as a signpost pointing to the Stack Overflow question too... – voretaq7 Jul 10 '13 at 15:25
up vote 3 down vote accepted

There is a similar question en Stack Overflow:

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)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.