Re: Expect timeout problem. I needs help.
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 12:21:54 +0100
zelzel.zsu@xxxxxxxxx wrote:
You miss the point.OK
actually what expect looking for is a pattern and then take an action. If it can find "Password: ", it certainly can match "Password".
YES( and this has not changed since expects inception) , but expect functionality needs to be used ( by you ) in a sane way.
actually you could expect just "d :" and get perfect results.
what su does is
#define MAXPASS 8
char ispass[10]
putc("\r",stderr)
putc("\n",stderr)
putc("P",stderr)
putc("a",stderr)
putc("s",stderr)
putc("s",stderr)
putc("w",stderr)
putc("o",stderr)
putc("r",stderr)
putc("d",stderr)
< your expect "Password" is successfull here and
you start talking after some
indeterminate delay >
putc(" ",stderr)
< either here
putc(":",stderr)
< or here
termctrl(noecho)
< or even later
termctrl(flushinput)
< su starts listening here >
< only the cases where you start as late
< as this point you script runs sucessfully
fgets(ispasswd,MAXPASS,stdin)read my anwser again!
Badly
The scripts do runs!!
The only problem is sometimes we get a timeout problem.Right, now how come?
You are right: this is a typical error make by expect beginners.I've search in comp.lang.tcl and found that there are not a few people who have encounter this problem.
But I haven't find the solution yet.
I seem to remember that at least twice answers to the exact same problem where given in the last 3 weeks.
uwe
.
- Follow-Ups:
- Re: Expect timeout problem. I needs help.
- From: zelzel.zsu@xxxxxxxxx
- Re: Expect timeout problem. I needs help.
- From: zelzel.zsu@xxxxxxxxx
- Re: Expect timeout problem. I needs help.
- References:
- Expect timeout problem. I needs help.
- From: zelzel . zsu
- Re: Expect timeout problem. I needs help.
- From: Uwe Klein
- Re: Expect timeout problem. I needs help.
- From: zelzel.zsu@xxxxxxxxx
- Expect timeout problem. I needs help.
- Prev by Date: tbcload for 8.5
- Next by Date: Re: Understanding of simpletest utility
- Previous by thread: Re: Expect timeout problem. I needs help.
- Next by thread: Re: Expect timeout problem. I needs help.
- Index(es):