Actually, I don't think you can. From what I know, cmd() matches against the prompt. That's fine if the first time you see a prompt, it's been matched against a specific cmd or other call. What I'm talking about isn't the possibility of matching against a funky new prompt or something, which I kinda think is what you're suggesting. The problem I have is that there's a prompt which comes up *the second* I connect to the device. In other words, there's no way I can match against it and remove it from the buffered stream. And clearing the buffer doesn't beat that in my experience either.
When you capture the output from a 'cmd()' the way it seems to work is that it reads the buffer of everything which has occurred in the telnet session so far. That buffer is matched against for every call made against the router, and every prompt is accordingly dealt with. So if you have a prompt appearing anywhere in the stream and it's not been matched, then all of your matched output will be one prompt behind.
Sorry if you're dead right and I've missed it, but I can't see what the prompt documentation provides for other than matching against a given string.
| [reply] |
$session->waitfor_pause(1) may be a workaround.
/chAlx
| [reply] [d/l] |