php7.2 expect_expectl match returns always empty
| From: | Julio Araujo | Date: | Tue, 12 May 2020 03:33:20 +0000 |
| Subject: | php7.2 expect_expectl match returns always empty | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-327154@lists.php.net to get a copy of this message | ||
Hello,
(what I did)
I'm writing a php script to connect remotely to a server and handle some commands in order to get some information and then decide to execute or not some actions.
I thought the execpt module would be better to use than ssh2_connect because exepct module provide, in my opinion, a better the stream control from the remote host that is provided by the function expect_expectl.
(what I expected to happen)
I was expecting that the match parameter would became a variable filled with all the string content that has been matched by expect_expectl function.
(what happened)
The match parameter content returns always empty.
I also tried to use the sample from the php documentation from the link: https://www.php.net/manual/pt_BR/function.expect-expectl.php, but doesn't work too.
Follow below some more information about my system:
SO: Ubuntu 18.04.4 LTS
PHP version: PHP 7.2.30
I also searched in the internet and in the bug report for any problem like this but unfortunately I could not find any than this email at the link: https://marc.info/?l=php-general&m=143863998815695&w=2
I'm trying to write the script using fread instead of expect_expectl function but as I describe above I think that the expect_expectl function provide a better stream control if I'm able to use the match parameter.
Best regards,
Julio