Re: how to expect a string
- From: Ed Morton <morton@xxxxxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 22:57:13 -0500
Atropo wrote:
this was posted on comp.unix.admin as a mistake.
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.
You could do something like this:
proc1 > log &
pid=$!
while [ -n "$pid" ]
do
sleep 1
grep "ready" log &&
kill [-whatever] "$pid" &&
pid=""
done
Regards,
Ed.
.
- Follow-Ups:
- Re: how to expect a string
- From: Atropo
- Re: how to expect a string
- References:
- how to expect a string
- From: Atropo
- how to expect a string
- Prev by Date: E-Books Uploded
- Next by Date: E-Books Uploded (Bash Scripting Guide)
- Previous by thread: how to expect a string
- Next by thread: Re: how to expect a string
- Index(es):
Relevant Pages
|
|