【发布时间】:2011-04-17 15:08:40
【问题描述】:
我正在使用以下代码
#!/usr/bin/expect -f
#!usr/bin/expect
#package require Expect
puts "Hello world"
spawn ssh xyz@172.31.112.182
expect -nocase "password:"
send "abc123\r"
puts "done"
执行时报错
Hello world
invalid command name "spawn"
while executing
"spawn ssh xyz@172.31.112.182"
(file "temp.tcl" line 9)
我的代码有什么问题
【问题讨论】:
-
如何调用脚本?如果您致电
tclsh script,则需要取消注释包要求。