The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to verify that copied data to remote system is identical with local data. ynilesh Shell Programming and Scripting 3 01-31-2008 05:55 AM
Howto capture data from rs232port andpull data into oracle database-9i automatically boss UNIX for Dummies Questions & Answers 1 09-22-2007 11:35 PM
Using loop reading a file,retrieving data from data base. Sonu4lov Shell Programming and Scripting 1 01-19-2007 12:38 AM
Submitting jobs remotely...Experts help reqd arijit UNIX for Advanced & Expert Users 3 02-08-2006 10:02 PM
Unix Program for data and print miketaylor UNIX for Advanced & Expert Users 5 05-21-2002 07:49 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-03-2007
Registered User
 

Join Date: Dec 2007
Posts: 2
submitting data during a program run

I'm new to this and didn't know what my problem is called but here it is:

A program called "prepdata" is run which asks the user to enter in a <input> file for the data to be taken from. However, it won't accept that input filename as an argument:
$ prepdata <input> will NOT work

prepdata reads it from the user after prepdata is already running:
$ prepdata
Enter an input file:
<input>

$


I'd rather not attempt to edit the prepdata program for it to accept <input> as an argument. How can I get a script to "type" in the <input> filename when prepdata asks for it?
It's like I need the script to send raw keyboard input after a certain amount of time but I have no idea how to do that.
Reply With Quote
Forum Sponsor
  #2  
Old 12-03-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Pipe the data as stdin

Code:
echo "<input>" | ./prepdata
or

Code:
./prepdata <<EOF
<input>
EOF
Reply With Quote
  #3  
Old 12-03-2007
Registered User
 

Join Date: Dec 2007
Posts: 2
Bah!
I looked at piping hours ago. Obviously I had it backwards.
Sorry for the trivial question, and thanks for the quick response.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0