Re: Expect timeout problem. I needs help.
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 09:14:33 +0100
zelzel.zsu@xxxxxxxxx wrote:
I am new to expect and tcl.
All .. I want to do is: spawn su and chech my root password.
But when i run the script. sometimes the root password was accepted. sometimes the expect timeout, with dit not verify the root password.
So this script simply could not work. 1. what is time source of timeout problem? 2. how to solve it?
thanks.
the source: root.cl <<<<<<<<<<<<<<
[brian@brian brian]$ cat root.tcl #!/usr/local/bin/expect -f
# 1. start su interpreter spawn "su" set timeout 5 expect "Password" { send "google\r"}
Are you shure this is what your su cmd tells you? Mine says: "Password: "
If you do not expect the ":" and "<space>" after "Password" you send the password while su is still talking to you. This is impolite and su goes into a sulk. Actually it discards all input received when finished with sending the prompt and then waits for your input in nonecho mode .
uwe .
- Follow-Ups:
- 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
- Expect timeout problem. I needs help.
- Prev by Date: Re: time command oddity exists not
- Next by Date: Packaging Tcl/Tk Application on Windows: Single File Executable
- Previous by thread: Expect timeout problem. I needs help.
- Next by thread: Re: Expect timeout problem. I needs help.
- Index(es):
Relevant Pages
|