-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Program hangs when I try to execute Expect with unexpected string
child, err := gexpect.Spawn("passwd test")
if err != nil {
log.Fatal(err)
}
err = child.Expect("YOU WILL NEVER FIND ME")
if err != nil {
log.Println("should print error", err) // should print error, but it never execute
}
I want to do this because there could be different results for one command. For example, ssh $hostname ls /tmp may output the directory information of tmp directly if the ssh public key has copied to the host, or get the prompt for the password, I found it only works well with non-interactive command.
Metadata
Metadata
Assignees
Labels
No labels