Que tal usar read
?
$ cat /dev/null | read pointless || echo no output
no output
$ echo something | read pointless || echo no output
$ printf "\n" | read pointless || echo no output
$ printf " \n" | read pointless || echo no output
$ false | read pointless || echo no output
no output
De acordo com a definição do Open Group :
EXIT STATUS
The following exit values shall be returned:
0
Successful completion.
>0
End-of-file was detected or an error occurred.