zombieZero
Technical User
I've encountered an interesting problem...I have a generic proc that sends commands to a cli, and returns the responses. Among other things, I use this to pull the current configuration from the box. In theory, this proc should work no matter what device I use it on, and for the most part this is the case, but recently I've turned it on a new CLI and I'm hitting a strange problem.
The command goes down, and it does generate a response; that part does still work, but the response which returns is inconsistent. The re I use is:
expect {
-i $sid -re "(\[^\r]*)\r\n" {
lappend menuList $expect_out(buffer)
}
...according to 'Exploring Expect', this should mean 'everything'...so basically, just capture the whole thing in the buffer and return it to me. About half of the time it does, but the other half of the time I get either half the output, or none of it.
The longer the configuration is, the worse the results. I thought at first this was a buffer size problem, so I increased the max_match size to 4000 (from the default of I believe 2000), but this did no good.
Does anyone have an angle on why this might be happening? Are there any known control characters or other strange output I might be getting back that could explain the inconsistent results of the expect_out(buffer)?
The command goes down, and it does generate a response; that part does still work, but the response which returns is inconsistent. The re I use is:
expect {
-i $sid -re "(\[^\r]*)\r\n" {
lappend menuList $expect_out(buffer)
}
...according to 'Exploring Expect', this should mean 'everything'...so basically, just capture the whole thing in the buffer and return it to me. About half of the time it does, but the other half of the time I get either half the output, or none of it.
The longer the configuration is, the worse the results. I thought at first this was a buffer size problem, so I increased the max_match size to 4000 (from the default of I believe 2000), but this did no good.
Does anyone have an angle on why this might be happening? Are there any known control characters or other strange output I might be getting back that could explain the inconsistent results of the expect_out(buffer)?