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:
If you want something more complex, then you can pipe a file in:
Or create some program of your own to generate the output.