Re: How to expect a string on a log file



"Atropo" <lxvasquez@xxxxxxxxx> writes:

Sorry, maybe the subject was somehow vague.
what I want is .

I had a process (proc1) with that writes to a log. when this process
came up it writes a "ready" on the log , about 1 or 2 mins later. I
would like to raise another instance (proc2), check the log and wait
for the "ready" string, then kill the old proc1. don't know how to get
out of "tail -f log|grep ready" when it appears. I treated with
"expect" but culdn't find an easy help on it, and to be honest don't
understand a bit of it. Hope you give me some advice or better
approach.

I don't know the answer to your question, but I'm thinking there
simply has to be a better way to do inter-process communication here
than scraping log files with tail and grep and killing processes.

Are both of these running on the same box? What language(s) are you
constrained to if any? This may be a useful opportunity to learn
Perl.

--
Todd H.
http://www.toddh.net/
.



Relevant Pages

  • finding process and waiting for it to end
    ... I am working on a jscript that launches a process (proc1). ... Proc1 launches a secondary process (proc2) and then exits. ... I want my script to launch proc1 and then find the process associated ...
    (microsoft.public.scripting.jscript)
  • waiting for input of widget and return input value
    ... run proc1, then proc1 will invoke proc2 and popup some checkbutton for ... to invoke proc3, proc3 will check which button was checked and return a ... checked variable list, then proc2 return the list to proc1, and proc1 ... proc proc1 { ...
    (comp.lang.tcl)
  • Re: Is this a legitimate use of "reutrn -level"?
    ... puts "This is proc0" ... proc proc1 { ... proc proc2 { ...
    (comp.lang.tcl)
  • Re: About Lists of Pointers
    ... > In Proc1, the address of a local variable is pushed. ... is NOT the same as Addr, although both return pointers. ... When Proc2 gets called ...
    (borland.public.delphi.language.objectpascal)
  • Re: About Lists of Pointers
    ... "Steve B" wrote ... > In Proc1, the address of a local variable is pushed. ... > So why is the address still valid in Proc2? ... "by chance". ...
    (borland.public.delphi.language.objectpascal)