-   Programming (
-   -   bourne shell scripting ..input .. (

91change 07-29-2008 07: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 07: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.

yes | /path/to/a.out

jschiwal 07-29-2008 08: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 10:21 PM.