Is there already a program that reads multiple pipes or file descriptors and writes to the standard output (not splitting lines).
Like cat
, but reading all files simultaneously and preserving lines.
Something like:
until(all fds are EOF) {
select(multiple fds);
read a line from triggered fd;
write the line to the stdout;
}
It is needed to avoid coding of select/epoll loops or using multithreading in simple programs. Like "select loop for bash".
Update: I've also created a similar question on unix.SE.