Super User is a question and answer site for computer enthusiasts and power users. 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 run a curl command, grep the output (response payload) for some keywords, then also print some metrics via the -w option.

I think this would be easy to do if I could direct the -o output into a stream that is distinct from the -w output (which is always stdout).

tee sends the output of BOTH -w and -o (that is to say, stdout) to multiple places. I want the output of -w to go to one stream, and the output of -o to go to another stream.

How?

share|improve this question
    
can you not do this using tee? can you post a sample of the curl command you want to run? – dinesh Feb 27 '13 at 20:59

Try tee. From the manpage:

# source_program | tee (> program1) (> program2) (> programN)| programN+1

share|improve this answer
    
tee sends the output of BOTH -w and -o to multiple places. I want the output of -w to go to one stream, and the output of -o to go to another. – Cheeso Feb 28 '13 at 23:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .