LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-20-2010, 05:02 AM   #1
keeperofdakeys
LQ Newbie
 
Registered: Dec 2009
Location: Adelaide, Australia
Distribution: Slackware
Posts: 8

Rep: Reputation: 0
bash jobs over multiple instances


I know that bash can suspend and resume processes, but I am interested in forking and resuming them from different bash instances. So, for example, forking a gui app started from the console so that it will not crash when the terminal is closed.

I currently know about screen, which can work, but I was wondering if there was a way similar to Ctrl+Z, bg and fg.
 
Old 05-20-2010, 07:44 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,024

Rep: Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399
Have you looked at retty?

Evo2.
 
Old 06-06-2010, 05:07 AM   #3
keeperofdakeys
LQ Newbie
 
Registered: Dec 2009
Location: Adelaide, Australia
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: 0
I have pretty much solved my question, I'll leave my answer for other's reference

let's use gedit as an example
1. if you run it from a terminal like this: gedit, that terminal must be open for gedit to still run
2. if you do: gedit &, then the program will run after you exit bash if you use the exit command, but if you use a window managers close button on a termianl, then gedit is killed
3. if you do: (gedit &), then the program is run as a daemon process in an external bash instance, so it will keep running even if you force the terminal to close

so use (program &) to ensure it will keep running

ps. the (command) allows handy things like, for example, if bash pwd is /, then you run (cd /somewhere; somecommand), then the command will finish with bash in / still
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script iterating multiple instances of java GUI on different desktops rockdiablo Linux - Desktop 2 06-23-2009 08:35 AM
Multiple Apache Instances piforever Red Hat 4 10-05-2008 09:18 AM
Multiple instances tekmann33 Linux - Newbie 1 01-28-2008 04:05 PM
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-22-2007 12:18 AM
bash script: run multiple jobs in bg, & kill them separately? mattengland Programming 1 03-26-2006 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:45 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