How can I select() (ie, simultaneously read from) standard input *and* a file in bash?
问题 I have a program that accepts input on one FIFO and emits output to another FIFO. I want to write a small script to control this program. The script needs to listen both to standard input (so I can input commands to adjust things in real time) and the program's output FIFO (so it can respond to events happening there as well). Essentially my control program needs to select between standard input and a file (my FIFO). I like learning how to figure out how to develop simple and elegant bash