LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-29-2008, 07:30 AM   #1
91change
Member
 
Registered: Jul 2008
Posts: 42

Rep: Reputation: 15
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
 
Old 07-29-2008, 07:44 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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
 
Old 07-29-2008, 08:39 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

Last edited by jschiwal; 07-29-2008 at 08:46 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bourne Shell Programming help! radmofopunk Programming 27 04-24-2006 04:13 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 10:20 AM
Another easy Bourne Shell Scripting question WinterSt Programming 7 09-02-2004 08:41 PM
Bash Shell vs Bourne infamous41md Linux - Newbie 14 04-11-2003 11:16 PM
Bourne Again SHell help MagInnovision Linux - Newbie 2 02-04-2003 04:43 PM


All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration