How to capture output of expect script command with expect_out? -


#!/usr/bin/expect -f spawn telnet ip port expect "escape character '^]'" send loadtime set accum {}  expect {     -regexp {..*} {         append accum "${accum}$expect_out(0,string)"          exp_continue     } } puts $accum 

the output of loadtime command looks "load time: 2.45" however, on executing script, $accum displays "loadtime" , not "load time: 2.45"

how capture output of loadtime command in variable or local file?

you forgot press enter key: send "loadtime\r"


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -