I have a command line application I need to execute from my PHP web application. Say the command is the following:
foo -arg1 -arg2 -arg3
Based on certain conditions, the command line application will prompt user to hit the enter key (e.g. “Please press enter to continue.”).
From my PHP application, how do I execute the command line AND send the enter key as response to the prompt?
I’m developing on WAMP. Production code is LAMP.
That’s what the ‘yes’ program is for. It dumps an endless stream of ‘y\n’ (or whatever you tell it to via arguments) to the program. It exists for this purpose (answering ‘yes’ to “do you want to continue” prompts).