Differences between revisions 1 and 2
Revision 1 as of 2007-09-09 01:04:23
Size: 214
Editor: irc2samus
Comment:
Revision 2 as of 2007-09-09 08:33:33
Size: 448
Editor: ppp073-116
Comment: uh ? what is this faq about
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:

What problem are you trying to solve?
Open a program that reads the pipe and send the output of several commands to it?
like:
{{{
mkfifo myfifo
cat < myfifo &
exec 3>myfifo
echo blah >&3
echo more blah >&3
exec 3>&-
}}}

Anchor(faq85)

How do I prevent a named pipe from closing?

We've found two ways so far:

  • Using a loop
    •   while cat myfifo; do :; done
  • Using tail
    •   tail -n +1 -f myfifo

What problem are you trying to solve? Open a program that reads the pipe and send the output of several commands to it? like:

mkfifo myfifo
cat < myfifo &
exec 3>myfifo
echo blah >&3
echo more blah >&3
exec 3>&-

BashFAQ/085 (last edited 2016-10-17 20:45:47 by 163-172-21-117)