Hi All,
I'm trying to learn to use the automation scripting tool Expect here I have a script named ExpectPass.
On my computer I have a user account named j
So From root I try runing ./ExpectPass j
Code:
#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eof
From there, Im just not sure how to put in a password. The shell does prompt briefly, for a "Enter new Unix password:" but its not taking input as far as I can tell. If i type anything at this prompt I get:
Code:
# y7
newpass: command not found
If I dont type anything I end up back at the prompt.
Can anyone explain what is going on here?
This is an example from the book "Exploring Expect", Page 5
Please help!