Results 1 to 3 of 3
Assuming I have an executable:
Code:
for (;;){
x=getchar();
if(x=='q') {
printf("exit");
exit(0);
}
else
printf("Press a key");
}
How to write a script to drive this executable simulating human ...
- 07-06-2011 #1
use bash to drive executable, and process stdout from the executable.
Assuming I have an executable:
How to write a script to drive this executable simulating human behavior?Code:for (;;){ x=getchar(); if(x=='q') { printf("exit"); exit(0); } else printf("Press a key"); }
For example: send 'a', 'q' and process executable stdout message (printf);
Great thanks,
A short example script is very very much appreciated.Last edited by legendbb; 07-07-2011 at 01:30 PM.
- 07-07-2011 #2
Or other tools to use in driving this executable.
Please suggest.
- 07-07-2011 #3
Maybe expect will help you
Code:man expect
You must always face the curtain with a bow.


Reply With Quote