[H-GEN] Foregrounding a task

Greg Black gjb at gbch.net
Mon Apr 24 07:37:50 EDT 2006


On 2006-04-24, Ben Fowler wrote:
> Rick Phillips wrote:
>>> I was running a process on a remote machine when my host went down.  The 
>>> process on the remote box still shows as running, but I can't see any way 
>>> of foregrounding it so I can save my work.  Experimenting with signals 
>>> using another instance of the program merely results in either exits or 
>>> suspends, but maybe there's a signal that I should try that I haven't 
>>> (I've tried CONT).
>> 
>> Try running the bash command "fg".  That should foreground any job
>> running in background.
> 
> The bash(1) manpage will have more detail, but it's worth mentioning 
> 'fg' can be used on more than one background task.
> 
> Use 'jobs' to get a list of child processes running under the shell.  

The problem here is that "the shell" in question has exited, as
per the original description.  So there's no way to foreground
the remote process.

> P.S. I can name at least half a dozen HUMBUGgers who swear by screen(1). 
> It can do loads of stuff, like having multiple shells in one window, 
> split screen, keyboard locking and loads of other things.  It really 
> comes into its own when you're on a dumbterm or something similar -- 
> it's like Linux virtual terminals, but even more useful.

That list leaves out one interesting capability, which would
have been useful in this case.  The problem is that you can't do
it retrospectively.

All that can be done is to learn for the future.  If this kind
of thing is likely to be an issue, learn to save your work often
enough (or use software that manages that trivial task for
you).  Or else run it under something like screen which, if run
correctly, can be waiting for you to connect to when you resume
normal service.

By the way, since there are always circumstances where things
will break, learning to save your work at intervals that fit
with your pain tolerance is the best solution ...

Cheers, Greg




More information about the General mailing list