LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 09-02-2009, 12:08 PM   #1
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
[bash]Pick up process running in back up by another terminal...


wow the title was avoiding me...

what happens is the following, I am compiling something that will take a while, but I have to go to work.

I did not add the && poweroff that I usually add when i leave the computer because I didnt know it was going to take that long...

the question is:

Is there a way to open a new terminal and pick up that runing process and add a trap to it or something similar?
 
Old 09-02-2009, 12:18 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
I am not sure if I understand what you mean but 'screen' might be what you're looking for.
 
Old 09-02-2009, 12:21 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Not that I know of but you could write a script that runs a delayed loop (a loop with a sleep in it) that checks whether that process is running and when it isn't executes poweroff.
 
Old 09-02-2009, 12:48 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by RaptorX View Post
wow the title was avoiding me...

what happens is the following, I am compiling something that will take a while, but I have to go to work.

I did not add the && poweroff that I usually add when i leave the computer because I didnt know it was going to take that long...

the question is:

Is there a way to open a new terminal and pick up that runing process and add a trap to it or something similar?
You can write the command in the same terminal and then press enter, once the task at hand ends the next command will run.

However if you can identify the main process of the compilation you could very well use the "wait" command in other terminal to wait for that process to end. That's risky however, because compilations usually spawns a lot of child processes and they can be hard to identify.
 
Old 09-02-2009, 01:09 PM   #5
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Original Poster
Rep: Reputation: 37
@i92guboj

lol that is something that I knew since the dawn of time (that while it is working you can actually type a command and when the other finishes then the command gets executed) but now that i REALLY NEED IT i didnt remeber... Thanks I guess that solves it
 
Old 09-02-2009, 01:29 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by RaptorX View Post
@i92guboj

lol that is something that I knew since the dawn of time (that while it is working you can actually type a command and when the other finishes then the command gets executed) but now that i REALLY NEED IT i didnt remeber... Thanks I guess that solves it
hehe, yeah, it happens from time to time to everyone that we don't see the evident thing and instead try to find some sophisticated way to solve a trivial problem, no one is immune to that
 
  


Reply



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
attach to an already running terminal-bash session kpachopoulos Linux - Newbie 5 10-12-2021 10:55 PM
bash `kill`: process 'B' silently dies; but process 'A' = `kill` spews back debris! GrapefruiTgirl Programming 9 06-23-2009 09:42 AM
Bash script to check if process is running and send email depam Linux - Newbie 2 04-08-2009 12:11 AM
Obtain ip address and check for running process via Bash Script? xconspirisist Programming 10 09-12-2008 01:18 PM
what is command to display the process which is running in the back ground vinaykori Linux - General 2 02-07-2008 09:35 PM

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

All times are GMT -5. The time now is 02:41 PM.

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
Open Source Consulting | Domain Registration