running a program in the background in the child emulator process
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
running a program in the background in the child emulator process
Hi all,
I wonder how one can, if at all, run an X program in the background *in an emulator sub-shell process*. What I mean is to launch a program in an emulator, e.g, by
xterm -e gedit
but with gedit (in this example) running in the background from inside the xterm sub-process, so that the xterm will accept other commands. In the above, gedit will run in the foreground, and of course, if you do
xterm -e gedit &
then xterm will run in the background, not gedit.
In short, I would like to achieve the same thing as "gedit &" as you manually do in xterm, but from another shell. What I aim to do is write an X init script to achieve this result (to have the emulator open and a program or two running from it, in the background, at the X startup).
I was able to make it work this way. Create a shell script, and make it executable:
Code:
#! /bin/sh
# geditsh
#
gedit &
Now, from your commandline:
Code:
xterm -e './geditsh; bash'
Thanks this has worked, for xterm at least. But in connection with how it should behave on exit,
Quote:
Originally Posted by theNbomr
You haven't prescribed how you want things to behave on shutdown.
I would like all the launched X programs to quit with the emulator itself. They do with xterm or gnome-terminal, but with my favourite emulator, Terminator, they do not for some reason. I wonder why this is the case...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.