logging out leaving a command running

Byron Poland wpoland at gmail.com
Mon Jan 23 16:56:48 UTC 2006


On 1/23/06, Peter Garrett <peter.garrett at optusnet.com.au> wrote:
> On Mon, 23 Jan 2006 14:28:38 +0800
> "Michael T. Richter" <ttmrichter at gmail.com> wrote:
>
> > On Sun, 2006-22-01 at 22:57 -0700, jim barnes wrote:
> > > From man bash:
> > > If a command is terminated by the control operator &, the shell executes the
> > > command in the background in a subshell. The shell does not wait for the
> > > command to finish, and the return status is 0
> >
> > > script &
> > > exit
> >
> > > That's all!
> >
> > Have you tried anything like that ever?  Try something that will take a
> > long time to run -- a "find / &", say, and then exit.  Keep an eye on
> > running processes.  (You can do it all in one terminal window by using
> > tabs.)
>
> cd music && mpg321 brahms/* &
>
> < hit enter again to get a prompt, as mpg321 likes to tell you what is
> playing>
>
> jobs
>
> [1]+  Running                 mpg321 * &
>
> disown %1
>
> exit
>
> My music is still playing as we speak :)  My terminal is gone...
>
> (But I agree that "screen" is a much better solution to the OP's problem)
>
> Peter

Screen works like a charm, thanks everyone.
 In case anyone ever looks this up in the archives.

I ran:

screen, started script, hit ctrl-a then ctrl-d, logged out.  logged
back in, screen -l (gives list of active screens), screen -r
screen-name (from the list), and you are all hooked up again.




More information about the ubuntu-users mailing list