首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Iperf with tcl expect命令

Iperf with tcl expect命令
EN

Stack Overflow用户
提问于 2012-04-18 19:24:22
回答 1查看 813关注 0票数 0

我想通过运行tclscript (自动化)来运行iperf命令。要在另一台PC (Linux)上运行的iperf命令。我正在使用tclexpect执行相同的操作,要求打开一个控制台并运行iperf命令。代码如下所示。

代码语言:javascript
复制
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" 

请帮帮我。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-08-08 22:35:00

您就快完成了。

像这样修改你的最后两行。

代码语言:javascript
复制
expect ".*$"
send "pwd\r"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10208335

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档