Bash: create anonymous fifo
Posted
by
Adrian Panasiuk
on Super User
See other posts from Super User
or by Adrian Panasiuk
Published on 2010-09-03T15:18:17Z
Indexed on
2012/10/08
3:39 UTC
Read the original article
Hit count: 346
We all know mkfifo
and pipelines. The first one creates a named pipe, thus one has to select a name, most likely with mktemp
and later remember to unlink. The other creates an anonymous pipe, no hassle with names and removal, but the ends of the pipe get tied to the commands in the pipeline, it isn't really convenient to somehow get a grip of the file descriptors and use them in the rest of the script. In a compiled program, I would just do ret=pipe(filedes)
; in Bash there is exec 5<>file
so one would expect something like "exec 5<> -"
or "pipe <5 >6"
-is there something like that in Bash?
© Super User or respective owner