in reply to run X-application via system call?
Run and continue main prog operation:system("xterm -e bash --rcfile /path/to/my/file.pl") && die "XTERM FAIL: $!\n";
Execute your prog, fire off another command, and leave the xterm open with a new shell:system("xterm -e bash --rcfile /path/to/my/file.pl &") && die "XTERM FAIL: $!\n";
This was originally designed as part of a large shell script (mentioned in the thread Just hammering nails...). In the original rcfile, numerous ENV variables are set so that the new shell has what it needs in terms of PATHs and settings in order to run. The third variant allows both an rcfile and a command-line string to be executed and the window to remain open for further processing, an extremely powerful combination. I'm definitely not a shell script guru, but this was fun to write. The --rcfile option is bash2-specific, as are the interpretation of the -i and -c switches, but the final shell left open can be any shell or shell-like program, leaving you with three possible execution points.system("xterm -e bash --rcfile /path/to/my/file.pl -i -c \"$acommandst +ringtoexec && exec bash\" &") && die "XTERM FAIL: $!\n";
|
|---|