Executing more than one command with ssh2 exec

断了今生、忘了曾经 提交于 2019-12-20 04:28:04

问题


I have a script that runs one command. Based on that result, I can run the next command. Steps:run first script it puts me in global then from global I will run the next command.
First command:
$stream = ssh2_exec($connection, 'config global');
After this result I should run this cause I need to go into global
$stream = ssh2_exec($connection, 'get hardware cpu');


回答1:


you can do like this

$stream = ssh2_exec($connection, 'command1;command2');


来源:https://stackoverflow.com/questions/13414657/executing-more-than-one-command-with-ssh2-exec

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!