0
votes

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.

1
So what is the actual problem? Please describe how things are not working… - Donal Fellows
It cannot open a new terminal (console) on Linux PC and it cannot run iperf also. Moreover the control is not coming back to the main script - Senthil kumar

1 Answers

0
votes

You are almost done.

Change your last two lines like this.

expect ".*$"
send "pwd\r"