Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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