IIRC, there is in fact a way to tell if STDIN is connected to a tty. It might be a *nix system call. In fact, I recall doing this myself many, many moons ago for basically the same reason you are. I'd have to do some searching myself, but look for how to determine if a process is connected to a terminal instead of how to determine if STDIN is from a pipe, that will probably get you closer to finding an answer.
In reply to Re: How do I Determine if my script is being piped to?
by boftx
in thread How do I Determine if my script is being piped to?
by netguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |