LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   bourne shell scripting ..input .. (http://www.linuxquestions.org/questions/programming-9/bourne-shell-scripting-input-658976/)

91change 07-29-2008 06:30 AM

bourne shell scripting ..input ..
 
I have an executable file "a.out" . This will print some inforamtion and pause . Ask user "whether to continue " . user has to give y or n option .

I want to run the elf file inside bourne shell script .
.How can i give the option 'y' before i execute

colucix 07-29-2008 06:44 AM

You can pipe the output of the yes command to the executable: the answer yes is passed to the executable every time it queries for input.
Code:

yes | /path/to/a.out

jschiwal 07-29-2008 07:39 AM

Sorry, I'm not able to edit the post without it being swallowed up by xml meta-charaters. Please ignore.


All times are GMT -5. The time now is 07:35 AM.