0

I should enter confirmation code after my function execute. My command wait an answer but I can't reply.

$cmd = 'cd/ && cd .... && ....';
echo shell_exec($cmd);

I tried:

shell_exec($confirmation_code);

I must enter confirmation code after get permission for some access.

Stefan Becker
  • 5,695
  • 9
  • 20
  • 30

2 Answers2

0

Try this

$cmd = 'echo "Yes"| cd/ && cd .... && ....';
echo shell_exec($cmd);

Replace "Yes" by what you want

digitalway
  • 61
  • 7
0

Symphony Process command can do this for you:

https://symfony.com/doc/current/components/process.html#streaming-to-the-standard-input-of-a-process

Damian Dziaduch
  • 2,107
  • 1
  • 15
  • 16