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"
私を助けてください。