LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-13-2006, 07:18 PM   #1
marktaff
Member
 
Registered: Jun 2001
Location: Bellevue, WA (Seattle)
Distribution: SuSE 9.3-10.0
Posts: 53

Rep: Reputation: 15
Move a job from one bash shell to another?


Does anyone know if it is possible (and howto, of course) to move a job from one shell to another one?

The situation is that I would like to be able to start a job on my home computer while at work, then logout of that shell. Then when I get home, I'd like to open a new shell and have the job be running in the foreground in the new shell.

Thanks.
 
Old 01-13-2006, 08:05 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
My gut reaction is that this is excessively convoluted. I think you can do something like start a job in background and later bring it to foreground. I do not believe you can move a running process to another shell**.

Start by looking up background processes and see if that "clicks" for you.


**All processes have parent processes--in this case, a shell instance. You can't change your parents, and I doubt if Linux can either...
 
Old 01-13-2006, 08:10 PM   #3
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
It's quite possible and even easy

Screen command will do what you want. Run screen, start process, detach the screen with CTRL+A D. To re-attach run screen -x. You can also have several processes running under screen, create a new process with CTRL+A C and use CTRL+A with numbers to switch between running processes. Man screen. It doesn't really "move the process to other shell", but the effect is the same. The process will keep running (but out of sight) even if you log out.

I always have a screen running at one of the machines of my university. Keeps me connected to irc and present on the channels I want to be present at all times. When I re-attach the screen I'm also able to see what's been going on on those channels

Last edited by alienDog; 01-13-2006 at 08:22 PM.
 
Old 01-13-2006, 08:22 PM   #4
marktaff
Member
 
Registered: Jun 2001
Location: Bellevue, WA (Seattle)
Distribution: SuSE 9.3-10.0
Posts: 53

Original Poster
Rep: Reputation: 15
Excellent!

Quote:
Originally Posted by alienDog
It's quite possible and even easy

Screen command will do what you want. Run screen, start process, detach the screen with CTRL+A D. To re-attach run screen -x. You can also have several processes running under screen, create a new process with CTRL+A C and use CTRL+A with numbers to switch between running processes. Man screen.

I always have a screen running at one of the machines of my university. Keeps me connected to irc and present on the channels I want to be present at all times. When I re-attach the screen I'm also able to see what's been going on on those channels

Thanks alienDog! screen is exactly what I was looking for. I will test it out tonight.

Regards,

Mark
 
  


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
how to tell bash to move files to another folder? hq4ever Linux - Newbie 10 12-30-2010 04:15 AM
move mouse pointer from shell script malo_umoran Slackware 1 11-06-2004 09:31 AM
shell script fo run auto job in cron JolynnMarie LinuxQuestions.org Member Intro 0 04-28-2004 12:21 PM
adding a job to crontab via shell script tazio Linux - General 7 10-23-2003 03:44 PM
how do I move a directory in shell DKY Linux - Newbie 7 07-30-2003 06:33 PM

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

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