LinuxQuestions.org
Review your favorite Linux distribution.
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 10-13-2008, 11:11 PM   #1
kushkothari
Member
 
Registered: Oct 2008
Posts: 31

Rep: Reputation: 15
shell script commands


I want to run a program (c program) and then give the user input automatically
like:


/shell script command/

./xyz
(after compiling this statement i need to give few inputs) how can I add my input with this command(I have 10 inputs every one should wait for 10 sec.)
 
Old 10-14-2008, 02:09 AM   #2
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
I think you can use something called "expect". Haven't used ut myself, though.
 
Old 10-17-2008, 04:50 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 10-20-2008, 01:47 PM   #4
shakezilla
Member
 
Registered: Jun 2005
Location: U.S.
Distribution: xubuntu 8.10, linux 2.6.27-11-generic
Posts: 78

Rep: Reputation: 16
I think you're looking for pipes.

http://www.google.com/search?q=linux+pipe

http://www.freebsd.org/cgi/man.cgi?q...SE&format=html
 
  


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
commands in shell script ? wolfindark Linux - Newbie 5 07-07-2008 04:29 AM
help with shell script commands Andrew0 Linux - Newbie 1 04-15-2006 12:55 PM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
Shell Script Commands shandy^^^ Programming 16 02-09-2006 10:16 AM
Commands/Shell script ?? paraiso Linux - Newbie 11 04-21-2005 10:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:00 AM.

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
Open Source Consulting | Domain Registration