【发布时间】:2012-04-29 19:15:16
【问题描述】:
我想通过运行 tclscript(自动化)来运行 iperf 命令。要在另一台 PC (Linux) 中运行的 iperf 命令。我正在使用 tclexpect 来做同样的事情,要求是打开一个控制台并运行 iperf 命令。代码如下。
puts "\n Enter the port no : "
gets stdin sprt
puts "\n Enter the display intervel (in sec) : "
gets stdin sint
global spawn_id
set timeout 40
spawn telnet $ip
expect "login:"
send "$user\r"
set timeout 10
expect "Password:"
send "$password\r"
expect "$"
send "iperf -s -u -p $sprt -i $sint"
请帮帮我。
【问题讨论】:
-
那么实际的问题是什么?请描述事情是如何不工作的……
-
无法在 Linux PC 上打开新的终端(控制台),也无法运行 iperf。此外,控件不会回到主脚本