Detect presence of stdin contents in Bourne Shell
- by l0b0
I'm writing a Bourne Shell script that may or may not receive input from stdin (as in foo.sh < test.txt, non-interactively). How do I check whether there is anything on stdin, to avoid halting on while read -r line...?