Executing more than one command with ssh2 exec

2019-03-01 06:21发布

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');

标签: ssh command exec
1条回答
▲ chillily
2楼-- · 2019-03-01 06:56

you can do like this

$stream = ssh2_exec($connection, 'command1;command2');
查看更多
登录 后发表回答