Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interestingly, there are some circumstances where you actually want "cat file | program" and not "program < file". The case I have in mind is when file is actually a named FIFO which was not opened for writing. If you use cat, program will still run and only reads to stdin will block (but it can perform other things, possibly in different threads). If you use '<', opening stdin will block and program will probably block altogether.


With < on a FIFO it's the shell that blocks on opening before the command, e.g. cat, is run.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: