-1
#!/usr/bin/expect
set NUM [exec some command to ssh to a remote machine and return a number]
puts $NUM
while { $NUM != "0" } {
set NUM [exec some command to ssh to a remote machine and return a number]
sleep 5
}
以上是我的代码。它运行在期望脚本中。我想将变量NUM分配给某个ssh到远程机器的命令并返回一个数字(当我输入终端时,该命令将返回一个数字)。 我得到了错误:期望脚本变量赋值
100
while executing
"exec some command to ssh to a remote machine and return a number "qstat | wc -l""
invoked from within
"set JOBS [exec some command to ssh to a remote machine and return a number "qstat | wc -l"]"
的事情是,我已经拿到了号码,但我没有这个数字赋给变量NUM
谁能帮我调试这一块?谢谢
需要查看实际的错误消息。 –
这是实际的味精,我所做的只是替换命令 –
@TheZoo:使用'exec'中使用的命令更新文章。 – Dinesh