in reply to Re: Test whether STDOUT is connected to a file
in thread Test whether STDOUT is connected to a file

-t is not exactly what the OP asked for, but it's probably what he wants.
  • Comment on Re^2: Test whether STDOUT is connected to a file