How to change process status?
Dan Nelson
dnelson at allantgroup.com
Tue Jul 22 14:45:14 UTC 2008
In the last episode (Jul 21), EdwardKing said:
> From: "Fernando Apesteguía" <fernando.apesteguia at gmail.com>
> > On 7/21/08, EdwardKing <zhangsc at neusoft.com> wrote:
> >> I make a process running in background,like follows:
> >> $./a.out &
> >>
> >> I want to know how to change a.out from backgound to foreground
> >> and how to stop it?
> >
> > with "fg" and the number the shell returns after you placed the
> > process in the background. Let's say:
> >
> > $./a.out &
> > [1] 27537
> >
> > fg %1
> >
> > -- Here the shell will bring the process to the foreground --
> >
> > Now you can stop it with Ctrl-c for instance.
>
> I use FreeBSD7.0
>
> $./a.out &
> $
>
> There is show nothing,like such as [1] 27537
> Why?
/bin/sh doesn't print the job number when you background a process. You
can use the "jobs" command to list all backgrounded and suspended jobs.
In your case, you only have one job, so you can just run "fg %1" or
even "fg".
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-questions
mailing list