I'm using my Perl script to Net::Telnet to an AIX box and execute several consecutive scripts. Each one has to wait for the predecessor to finish before it can start.
Before Perl, I would log in using telnet, fire up the first script and then do "tail -f" on the job's log as each one writes to a separate one. When the job completed I'd get the last line saying "FINISHED". Then I'd know I can get on with the next one.
So how do I emulate that "tail -f" with Perl? Or do I take another approach to check whether the job has finished, e.g. grab the job's PID and periodically check if it's still there?
I'm afraid my code isn't really useful at this point. It is only the beginning. I'd appreciate any input. Thank you!
my $telnet = new Net::Telnet(Timeout => 35,Errmode => 'die');
$telnet->open("10.10.10.11") or die "Connection failed $telnet->errmsg
$telnet->print("user") or die $telnet->errmsg;
$telnet->print("pass") or die $telnet->errmsg;
@lines = $telnet->cmd("script_01") or die $telnet->errmsg;