Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2017-09-25 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (278 votes). Check out past polls.

    Notices?