2012-04-18 3 views
0

tclscript (자동화)를 실행하여 iperf 명령을 실행하고 싶습니다. 다른 PC에서 실행될 iperf 명령 (Linux). 나는 tclexpect를 사용하여 동일한 작업을 수행하고 있으며 콘솔을 열고 iperf 명령을 실행해야합니다. 코드는 아래와 같습니다.tcl 명령을 사용하여 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" 

도와주세요.

+1

실제 문제는 무엇입니까? 어떻게 작동하지 않는지 설명해주십시오. –

+0

Linux PC에서 새 터미널 (콘솔)을 열 수 없으며 iperf도 실행할 수 없습니다. 또한 컨트롤이 주 스크립트로 돌아 오지 않습니다. –

답변

0

거의 완료되었습니다.

이렇게 마지막 두 줄을 변경하십시오.

expect ".*$" 
send "pwd\r" 
관련 문제