سؤال

I want to put enter(carriage return) in telnet socket resource.

\r is not working. Please suggest how to do enter so that command will be fired in the socket.

like show version is a command that i want to execute on cisco switch. show version\r is not working.

Note: Socket is properly opened, problem is only with \r

$this->socketResource = fsockopen($this->nodeIp,$this->portNumber);
fputs($this->socketResource,'show version\r');

enter image description here

هل كانت مفيدة؟

المحلول

You should always put \n, \r, \t etc. in double quotes.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top