Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Detecting interactive/non-interactive shell (Perl Cookbook)

by ybiC (Prior)
on Jul 03, 2005 at 20:38 UTC ( #472070=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub I_am_interactive {
      return -t STDIN && -t STDOUT;
    }
    
  2. or download this
    sub I_am_interactive {
      local *TTY; # local file handle
    ...
      close TTY;
      return ($tpgrp == $pgrp);
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://472070]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-11-21 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (116 votes), past polls