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 am trying to make a RTSP client in bash. Problem is that I must make only one connection to the server through which it will send video frames. I can keep it on one connection up to the point at which server sends me Session ID code that I must use in the following requests (SET_PARAMETER and PLAY). So I must forward netcat's output to sed to get the Session ID, but then my connection gets closed, and after I extract Session ID, I must make a new connection to the server with netcat to start the stream... but there is no video, because I must keep it at only one connection.

So, can I somehow, sed the netcat's output, and echo it back what to send to the server, but not to let it close the connection?

(its the BusyBox netcat)

share|improve this question
add comment

1 Answer

Use tee to duplicate the output to a file and have sed work on that one while the main consumer of the output keeps the connection open.

share|improve this answer
add comment

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.