how to send text to a process in a shell script?

Posted by Martin on Stack Overflow See other posts from Stack Overflow or by Martin
Published on 2010-03-15T22:59:34Z Indexed on 2010/03/15 23:09 UTC
Read the original article Hit count: 151

So I have a Linux program that runs in a while(true) loop, which waits for user input, process it and print result to stdout.

I want to write a shell script that open this program, feed it lines from a txt file, one line at a time and save the program output for each line to a file.

So I want to know if there is any command for:
- open a program
- send text to a process
- receive output from that program

Many thanks.

© Stack Overflow or respective owner

Related posts about shell-script

Related posts about unix-programming