|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-22 11:36 UTC] spektom at gmail dot com
[2010-12-12 11:09 UTC] benjamin dot lugger at gmx dot net
[2011-01-09 03:51 UTC] spektom at gmail dot com
[2011-01-23 22:58 UTC] faustovaz at gmail dot com
[2011-01-24 01:09 UTC] spektom at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
Description: ------------ I think there is a limit on the length on witch the match is done. I use expect to do telnet backup of cisco routers, and now i want to use expect for php instead of perl. When i match what i want to return, i only get about 298 lines or 7.080 bytes, is there some kind of limit on what expect matches on? Reguards Klaus Reproduce code: --------------- <? function telnetbackup($ip,$un,$pw) { $stream = expect_popen("telnet $ip"); fwrite ($stream, "$un\n$pw\n"); sleep(1); fwrite ($stream, "sh run\n"); $cases = array ( array ("(.*)end\r\n", END, EXP_REGEXP) ); switch(expect_expectl ($stream, $cases, $match)) { case END: return $match[0]; break; case EXP_TIMEOUT: break; case EXP_EOF: break; default: die ("Error has occurred!\n"); } } echo "<br>\n<pre>".telnetbackup("10.10.10.10","admin","password")."</pre>\n"; ?> Expected result: ---------------- More lines matched. Actual result: -------------- Fewer lines then expected.