Imagine I have a script.sh on my server that asks for your name. You run the script and it says:
what is your name?
then you input your name and it prints:
hello name!
Is it possible, using php exec, to run such a script? That is to exec the script and somehow answer the different questions it could have?
Hope I am clear. What I am really trying to do is automate the “git pull” command from our dev server but it keeps asking for a username/password. I know I could use ssh certificate login to avoid that but my question still stands. Can I use exec() and answer future questions from the script.
It’s worth noting that the better solution in your case is to use SSH keys for authentication. But, you might be able to pull this off with PHP Expect.