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
Post a Comment