in reply to "Answer" questions in an interactive program?
Use Expect or alter your program to accept inputs as arguments?