idris-0.12.3: test/scripts/timeout
#!/usr/bin/env perl
use strict;
use File::Basename;
sub Usage {
my $name = basename($0);
print STDERR "usage: $name seconds shell-command...\n";
exit 2;
}
Usage if (scalar @ARGV) < 2;
my $timeout = shift;
alarm $timeout;
exec @ARGV;