Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: help need to read a listening log file

by markuhs (Scribe)
on Nov 26, 2009 at 08:13 UTC ( #809504=note: print w/ replies, xml ) Need Help??


in reply to help need to read a listening log file

Hi, this is the code in <code>-tags...

#!/usr/bin/perl use strict; use warnings; my $installLogFile = $ARGV[0]; my $destinationlocation = $ARGV[1]; sleep 1 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; }


Comment on Re: help need to read a listening log file
Download Code
Re^2: help need to read a listening log file
by jithu_indian (Initiate) on Nov 26, 2009 at 09:58 UTC
    Hi markuhs, thanks for the code , here the thing is I am automating GUI installation of application using win32 GUI module. once I click on install It will generate a log file and it took almost 40 min to 1 hr depending upon system resources. I tried the code provided by U . but it is coming once log is created and going to else coz the word 'SUCCESSFUL' only appear after 40 min , here I just want to tail the application until it reaches SUCCESSFUL , ofcourse if the installation didn't went of well we can't see the msg in log, there is constant keywork "TIME" at the end of the file ... So I want to tail the log file until it got the keyword "TIME" once it reads the keyword "TIME" then I can assume that installation is over either it is SUCCESSFUL or not, could u help in this.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://809504]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2014-09-02 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (20 votes), past polls