On Sat, Dec 4, 2010 at 8:02 AM, Ashish Verma <[email protected]> wrote: > Hi, > > I need to pass answers to a program using bash script. How is it possible. I > have surfed the net and was able to find the below solutions. However the > problem I am facing is, after the program accepts the first answer, it > doesn't accept the second for some unknown reason. > > *./command < answers.file*
Your answers.file need to contain the strings identically the same as you would enter them interactively in one line for each answer. For example if your bash script asks user for first name? then line one would "First" Next if it asks for last name, the line two would be "Last" > or > > *ans1| ./command* ------ works for only 1 answer as the space needs to be > avoided. > > If I type ans1 ans2, It takes both as answer to the first question. The key thing is have you created answers.file to mimic exactly the same way you would input in an interactive session? HTH -- Arun Khan _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
