LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How can I simulate key strokes events in other processes in linux? (http://www.linuxquestions.org/questions/programming-9/how-can-i-simulate-key-strokes-events-in-other-processes-in-linux-860390/)

RonBigman 02-03-2011 01:11 AM

How can I simulate key strokes events in other processes in linux?
 
Hi
I have a program that receive user input.
I want to run this program automatically without user interaction, and in order to do that I need to simulate key events.
How can I do such a thing?

The program I am running is partly java and partly shell.

The shell part is easily done by using:
./prog.sh <parameters (Parameters being a file containing parameters)
But the java doesn't work similarly.

Thanks
Ron

wje_lq 02-03-2011 06:16 AM

Quote:

Originally Posted by RonBigman (Post 4246731)
Hi
I have a program that receive user input.
I want to run this program automatically without user interaction, and in order to do that I need to simulate key events.

Use expect. A brief intro can also be found here.

RonBigman 02-06-2011 01:42 PM

Thanks it worked
 
The expect command is working perfectly

Thanks


All times are GMT -5. The time now is 05:46 PM.