Not much ode in the applicqtion interface. his one executes a scroipt then goes to interactive mode.
int exec_shell_command(char *);
int console_loop(void);
int main(void){
int i=0;
int count = sizeof(script)/sizeof(char *);
printf("%d %d\n",sizeof(script),count);
while(i < count) {
exec_shell_command(script[i]);
i++;
}
console_loop();
return 0;
The script is just static text I use for testing. Here is the example. I run the script in two parts or one part, each time join terminates and leaves the 'databes' attachments in a consistent state. So I can manually start up the second instance, taking output from the MEM structure already resident. Two external call here, one to the console loop and one to the executive with script. Very simple.
<
static char* script[] = {
"list",
"set LAZYJ 0 json.txt 100",
"set TEXT 1 grammar1.txt 10000",
"set CONSOLE 2 20 2000",
"list",
"join"};
"dup 2,3",
"set CONSOLOE 5",
"set LAZYJ 4 join.txt",
"join" };
/pre>
<
No comments:
Post a Comment