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

Re: gcc



On Mon, 24 Mar 1997, Seth Reinosa wrote:

> > On Mon, 24 Mar 1997, Seth Reinosa wrote:
> > 
> > > I have looked but have not seemed to find in the man gcc page how to
> > > extract data from a document into a program.

[deletions]

> well there is a command in VMS that lets me do it for each run of a
> program.
> I am trying to do the same in Linux.

 Ah. Do you mean that you want to have the program read its input from a 
file just as if that input were being typed in via the keyboard? Are you 
referring to the "/INPUT" qualifier to the VMS "RUN" command? (My VMS 
knowledge is very limited, but I think this is what you're referring 
to...)

 If so, it's actually simpler in unix. For example, if you were running 
the program 'foo', and you wanted it to read data from the file 
'bar.test' in the current directory, you'd type:

 % foo < bar.test

 (Note: '%' is just the prompt, you don't need to type that.) The '<' 
tells the shell to run the file into the standard input of the program 
'foo'. Actually, there are a lot of things you can do with this kind of 
shell 'redirection'. Take a look at the bash or sh or csh man page. (I.e. 
type 'man bash'.)

 Hope this helps!

Sincerely,

Ray Ingles              ||  "...it's not a plain, ordinary steel nut: it's a
        (810) 377-7735  ||   'hexiform rotatable surface compression unit',
                        ||   which is why it cost $2,043 for just one..."
inglesra@frc.com        ||   William Lutz, on Pentagonese, in _Doublespeak_


Reply to: