scenario :
I am installing a application , once it is kicked , it will create a log , the cursor should be there until the log is file reaches a specific keyword/sentence, though it is a log I don't know how much time it takes to complete writing the log file
Please help me in this scenario I wrote it like this
here after the cursor reaches "sleep WAIT until -f $installLogFile;" it is reading file it is going to else part b'coz still log needs to be updated with keyword once it reaches the end of the file SUCCESSFUL which is still need to write in the log filesleep WAIT until -f $installLogFile; chdir ($destinationlocation) || die $!; print "Changing directory to $destinationlocation\n"; chdir ('logs') || die $!; my $lastLine= `tail /1 $installLogFile`; chomp($lastLine); my $secondLastLine= `tail /2 $installLogFile`; chomp ($secondLastLine); $secondLastLine=~s/$lastLine//; chomp ($secondLastLine); if ($secondLastLine eq 'SUCCESSFUL') { print "successful\n"; } else { print " was not successful \n"; exit; }
In reply to help need to read a listening log file by jithu_indian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |