在执行时
$expect filename.exp user pwd ip
我得到了错误
无法执行“ssh -l user ip”:没有这样的文件或目录
的内容filename.exp
是这样的:
#!/opt/sfw/bin/expect -D
set OMC_Usr [lindex $argv 0]
set OMC_Pwd [lindex $argv 1]
set OMC_IP [lindex $argv 2]
set cmd "ssh -l $OMC_Usr $OMC_IP"
spawn $cmd
expect "Password:"
send "$OMC_Pwd\r"
interact
帮我继续
谢谢...