#!/usr/bin/perl -w use strict; my ($output); eval { local $SIG{ALRM} = sub {die "SSH timeout\n"}; alarm 15; $output = `/usr/bin/ssh -o ConnectTimeout=10 host.domain.com`; alarm 0; }; if ($@) { print "SSH timed out\n"; } else { print "SSH didn't time out\n"; }
In reply to Re^2: Perl Threads
by jpk236
in thread Perl Threads
by jpk236
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |