Re: Expect not working
It is unclear precisely what you are expecting (NPI), but perhaps the following might provide a nudge in the right direction:
Code:
#!/usr/bin/expect -f
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set COMMAND [lindex $argv 2]
set timeout 1
spawn ssh $SERVER
expect "*?assword*"
send "$PASSWORD\r"
expect "*\$$"
send "$COMMAND\r"
expect $
"We visited sixty-six islands and landed eighty-one times, wading, swimming (to shore). Most of the people were friendly and delightful; only two arrows shot at us, and only one went near -- So much for savages!" - J.C. Patterson