Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Timing out shell commands (paranoia)

by Dominus (Parson)
on May 02, 2001 at 18:31 UTC ( #77333=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      #!/usr/bin/perl
      # stopafter - run a command with a timeout
    ...
      alarm($time);
      exec @ARGV;
      die "Couldn't exec @ARGV: $!; aborting";
    
  2. or download this
        stopafter 300 command arg arg...
    
  3. or download this
        open FH, "stopafter 10 command |" or die ...;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://77333]
help
Chatterbox?
[Happy-the-monk]: Discipulus: are there any perl monks in Milano?
[Discipulus]: i the moment likely no
[karlgoethebier]: i wonder now it will be with my glasses.
[Discipulus]: Milan Perl Mongers seems frozen at 2009
[Discipulus]: karl you dont shoot with eyes, you shoot with the soul
[jkva]: Reminds me of Guardians of the Galaxy

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2017-10-20 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?