I want to run iperf command, by running a tclscript (automation). The iperf command to be run in another PC (Linux). I am using tclexpect to do the same and the requirement is to open a console and run the iperf command. Code is given below.
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"
Please help me.
You are almost done.
Change your last two lines like this.