I have the parent process doing some computation that involves outputting a lot of stuff to the terminal, and I have another portion of code that I would like to run in its own terminal, as this portion uses both stdin and stdout (it's basically just a while loop with a prompt).
Initially, I thought to have the second portion run as an argument to gnome-terminal.
From what I've read online, it seems the only way to do this would be to write the while loop function as a shell script, then use the export switch to run it; sadly, I don't know sh atm, so is there any way to specify the function name as an arg to gnome-terminal?
I would like to be able to do something like the following:
Code:
int otherFunction(...) {
/*while loop with prompt*/
}
int main() {
if (!fork()) { /*child*/
system("gnome-terminal -x \"otherFunction(...)\");
} else { /*parent*/
/*do other stuff*/
}