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 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

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

You must log in to answer this question.

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