From: Zed <zed...@gm...> - 2009-11-20 20:40:19
|
Hello. I'm trying to use perl Expect to fetch a large (500k or so) configuration dump from a router via ssh. I wrote a small sub to help: sub SendExpect { my $cmd = shift; my $pat = shift; $exp->send("$cmd"); $exp->expect($C_timeout, '-re', $pat?$pat:$prompt); return $exp->before(); } I call this sub to send a few admin commands first, which return output as expected. I then send the command to dump the full router config. The call to SendExpect returns only the first 150k or so of the config, sometimes as much as 170k, sometimes only about 100k. The next call to SendExpect sends another admin command. However, this call returns more of the router config from the previous call, not the output of the admin command. I can't figure out what I'm doing wrong here or how to fix it. Can anyone help me? Thanks. |