php-ssh-connection icon indicating copy to clipboard operation
php-ssh-connection copied to clipboard

multiple commands

Open vik0803 opened this issue 4 years ago • 2 comments

Hi,

I tried to use your package but it works well for every single command but when I use it within the for loop and have multiple commands in array it doesn't work as needed.

Eg:

cd /var/www/html mkdir abc cd abc touch index.html

now if we execute inflow it should create index.html file in /var/www/html/abc folder.

but whereas using ssh connection in for loop it does create index.html file in /home/ubuntu folder.

content of /home/ubuntu folder is as below folder: abc file index.html

Appreciate your help if you can guide me to use it as above solution that I am looking forward for.

vik0803 avatar Apr 26 '20 09:04 vik0803

@DivineOmega hope you can help on this.

vik0803 avatar Apr 26 '20 09:04 vik0803

@vik0803 Hi there.

Try running the commands individually and calling getOutput and getError between each command.

Alternatively it may just be loosing track of the current active directory. In which case you could try concatenating your commands using &&.

DivineOmega avatar Apr 26 '20 10:04 DivineOmega