Back when I was using kde on Kubuntu I wrote a Perl script to do routine tape back-ups. A stub ran continuously (started by Autostart) looking at the time every hour, and if a back-up was due, or over-due, it would send a Wall message and launch the interactive main script, which prompted the loading of numbered tapes. It worked fine.

When I wrote it I gave no thought to foreground/background running. The stub ran invisibly, and when a back-up was due a terminal opened for the interactive part. AFAIR the Wall message opened this window, and the script I/O followed on in the same window.

However, openSUSE 11.3 / KDE 4.4.4 broke it. Wall no longer opens a terminal, but causes a brief GUI pop-up from the task bar. I can see from “ps afx” that both the stub and the main scipt are running, but in the background presumably.

I have tried putting ‘system(“fg”)’ into my script but it just complains that it cannot execute “fg” (this complaint is only visible if I run the script manually in a bash terminal).

I have also tried putting ‘system(“bash”)’ into the script to try to open a terminal window, but that does not work either.

How do I open a terminal for the interactive part?

Terminal emulations have names like xterm and *konsole. *Not *bash, *that is a shell.