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?
| |||
|
feedback
|
|
Bash 4 has coprocesses. | |||
|
feedback
|
|
While none of the shells I know can make pipes without forking, some do have better than the basic shell pipeline. In bash, ksh and zsh, assuming your system supports
This is also useful to combat some of the shortcomings of basic shell pipes. For example, | |||
|
feedback
|
