Posted By

kkindoh on 07/08/06


Tagged

POSIX isatty STDOUT pipe


Versions (?)

How to determine if the output is screen or pipe.


 / Published in: Perl
 

  1. sub isOutputScreen {
  2.  
  3.   use POSIX;
  4.  
  5.   return 0 if POSIX::isatty( \*STDOUT) eq "" ; # pipe
  6.   return 1; # screen
  7. } # end of isOutputScreen

Report this snippet  

You need to login to post a comment.