LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 08-26-2009, 06:19 AM   #1
yosato_uk
LQ Newbie
 
Registered: Aug 2006
Location: London
Distribution: fedora, gentoo, openSuse
Posts: 13

Rep: Reputation: 0
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).

Help would be appreciated
 
Old 08-26-2009, 09:01 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Interesting problem...

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'
You haven't prescribed how you want things to behave on shutdown. Perhaps others can offer a slightly less creative solution.
--- rod.
 
Old 08-26-2009, 10:10 AM   #3
yosato_uk
LQ Newbie
 
Registered: Aug 2006
Location: London
Distribution: fedora, gentoo, openSuse
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by theNbomr View Post
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 View Post
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a background process and then logging off simplified Linux - General 10 10-10-2008 03:25 AM
Process running in background baddah Linux - General 3 02-22-2008 12:44 AM
running process in background forever danran Linux - General 2 11-19-2006 09:44 AM
Running kismet as a background process coolnicklas Linux - Software 2 01-04-2006 03:33 PM
background running process elbriga Programming 2 09-21-2004 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration