king
king

Reputation: 13

Can we use dynamic pipe?

I start two apps in linux such as A | B,so that the output of A will be redirected to B by pipe. When i kill B,it will generate a SIGPIPE,and I want to keep A alive and restart B,so that the output of A can still be redirected to B. How can I achieve it,dynamic pipe? Thanks.

Upvotes: 1

Views: 72

Answers (1)

that other guy
that other guy

Reputation: 123490

Just keep the pipe open and restart B when it dies:

A | while true; do B; done

Upvotes: 2

Related Questions