in reply to Open Control::CLI Command With Pipe
sub waitForCmd { my $href = shift(@_); return if ( not defined $href->{settings}->{nohup} ); # wait for the file # sleep 1 while ( ! -e "$href->{settings}->{runfolder}/$href- +>{settings}->{logfile}" ); open( FH ,'<', "$href->{settings}->{runfolder}/$href->{setting +s}->{logfile}" ); # keep track of spinner # my @sails = map { "\b$_" } qw{- \ | /}; my $sail = 0; # now search each line for job completed # FILE: for (;;) { while (<FH>) { print $sails[$sail++ % @sails] ; last FILE, if ( $_ =~ /Stopping AppMonitor Co +nnector| Failure| Maximum return code ex +ceeded for the run /xi ); } seek(FH, 0, 1); } close (FH); return; }
|
---|