View Single Post
Old Jun 17th, 2006, 2:47 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Not quite sure what you're asking. Most console scripts get input from the user via STDIN, and report back via STDOUT. You can pipe the STDOUT from one program to the STDIN of another by using pipes.

For example, the command "yes" outputs a continual stream of identical lines. By default, it's "y". Thus, by piping "yes" to a different program, you can get it to answer "y" to every question posed:
yes | some_program
If you want something more complex, then you can pipe a file in:
some_file > some_program
Or create some program of your own to generate the output.
Arevos is offline   Reply With Quote