LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   [bash]Pick up process running in back up by another terminal... (https://www.linuxquestions.org/questions/linux-general-1/%5Bbash%5Dpick-up-process-running-in-back-up-by-another-terminal-752144/)

RaptorX 09-02-2009 12:08 PM

[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?

sycamorex 09-02-2009 12:18 PM

I am not sure if I understand what you mean but 'screen' might be what you're looking for.

catkin 09-02-2009 12:21 PM

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.

i92guboj 09-02-2009 12:48 PM

Quote:

Originally Posted by RaptorX (Post 3667078)
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.

RaptorX 09-02-2009 01:09 PM

@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

i92guboj 09-02-2009 01:29 PM

Quote:

Originally Posted by RaptorX (Post 3667157)
@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 :)


All times are GMT -5. The time now is 10:29 PM.