Page 1 of 1

hides line

Posted: Wed Oct 12, 2005 8:47 pm
by akazukin
How can i hide this line "newSwitch#terminal length 0" from printing out??
part of the Output
Password:
newSwitch>en
Password:
newSwitch#terminal length 0
newSwitch#show run
Building configuration...

Current configuration : 2027 bytes
!
version 12.1
part of the source code

Code: Select all

$fp = fsockopen ($host, $port, $errno, $errstr);

  if (!$fp)
   {

  $results = "Error: could not open socket connection";
  }
else
  {
  	fgets ($fp, 1024);

	  fputs ($fp, $login_info[2]."\n");
	  fputs ($fp, "en\n");
	  fputs ($fp, $login_info[3]."\n");
	  fputs ($fp, "terminal length 0\n");
	  fputs ($fp, "sh vlan\n");
	  fputs ($fp, "\r");

	while (true)
	{
 		$tmpecho = fgets ($fp, 1024);

   		$moredetails .= $tmpecho;
   		fputs ($fp, "\r");

    	if (substr($tmpecho, 0,  == '------- ')
    	{
			break;
   		}
	}
   }
fclose($fp);

Posted: Wed Oct 12, 2005 8:57 pm
by feyd
comment the line from the code out :?

Posted: Wed Oct 12, 2005 10:01 pm
by akazukin
i can't comment tat out. If i did, it won't show the complete information. Instead it will pause at certain max. no. of line. The output was printed out by the looping. tat is why i was wondering how can i dump tat cisco command out from the output but it still doin the job?

Posted: Wed Oct 12, 2005 10:40 pm
by akazukin
problem solved. :lol: