Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 scrutinizing the Monastery: (4)
As of 2014-12-28 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls