Re: if the program need two input files

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

 



Thanks, it works.  Where I can get the more information about write
such a  shell script. Can you suggest some usful book or web for me?

On 6/4/05, inode0 <inode0@xxxxxxxxx> wrote:
> On 6/4/05, Frank Lee <lifei03@xxxxxxxxx> 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
> >
> > Expecting your suggestions.
> 
> Perhaps you can massage this construct into something that will work for you?
> 
> for f in $inFILE $outFILE; do echo $f; done | ./my_program
> 
> Since you mentioned an output file as an input to my_program I am
> assuming it writes its output there. You can wrap that snippet in
> another loop to change the values of inFILE and outFILE for multiple
> runs.
> 
> John
> 
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
> 


-- 
Do not guess who  I am.  I am not Bush in BlackHouse

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux