08-20-2013
2,
0
Join Date: Aug 2013
Last Activity: 21 August 2013, 6:01 PM EDT
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
Need help in basic conditional coding
Hi,
I am very new to coding and I am trying to figure out how to do one thing and I just can't figure it out. Here is what I am trying to do.
I can either get "yes/no" or "password" prompt. If I get yes/no, i like to send "yes" like I got it here but if I get "password" prompt, I like to send passw.
The way I got the script written, if I get password prompt first, the script will get stuck.
expect "(yes/no)?"
send -- "yes\r"
expect "*assword:"
send -- "passw\r"
Thanks in advance!