I’m executing a command inside a perl script and when that command completes, a question is sent to STDOUT requesting a Y or N answer to a question. If no answer is given (i.e. I just end the script) then we have a hung process in the shell waiting for an answer. How can I supply the desired Y answer?
perl v5.8.4
solaris 10
Simplest:
Use shell’s ability to redirect “Y” into command’s STDIN:
or (slightly worse but more flexible).
More complicated but infinitely more flexible and Perl native:
Use
Expectmodule