To give an input to a running process using shell scripts
I am writing a shell script, to build a program. During the process of building, the build asks the user to give an input(may be a enter or any number). How to give the input automatically(using scripts), wherein the previous process(the build) is still in execution while I need to give the input using scripts.
In the below program the make call need to be written in the scripts. Ex: make; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please Press Enter to Continue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press 1 to continue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press 2 to continue |
you may create fifos (named pipes) and read it in your program and write it from outside.
|
Sounds like you should look at the expect tool http://linux.die.net/man/1/expect
|
All times are GMT -5. The time now is 12:00 AM. |