[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: if the program need two input files



On Sat, Jun 04, 2005 at 03:57:01PM +0800, Frank Lee wrote:
> I have a program which waiting for the input  from from keyboard for
> more than two times.  Say,
> 
> #./my_program
> please input your input filename: (waiting for input from keyboard for
> the first time)
> please input your output filename: (waiting for input from keyboard
> for the second time)
> 
> 
> Because I need write a shell script to use this program for many
> times.   I do not how to avoid the interactive requirement of this
> program.  It seems it can not be solved by use
> 
> #./my_program <<input_file  >>output_file

This should be <inputfile.  >>output_file would be okay if you want to
append to an existing file.  If you want to create the output file, you
would use >output_file.

This assumes, of course, that my_program does its reads from stdin and
writes to stdout.  

-- 
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:ewilts ewilts org
Member #1, Red Hat Community Ambassador Program



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]