问题
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