From owner-freebsd-questions@FreeBSD.ORG Tue Jul 22 14:45:14 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A26F106567D for ; Tue, 22 Jul 2008 14:45:14 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id E23A78FC18 for ; Tue, 22 Jul 2008 14:45:13 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.2) with ESMTP id m6MEjCvV089936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Jul 2008 09:45:12 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.2/Submit) id m6MEjBHP089920; Tue, 22 Jul 2008 09:45:11 -0500 (CDT) (envelope-from dan) Date: Tue, 22 Jul 2008 09:45:10 -0500 From: Dan Nelson To: EdwardKing Message-ID: <20080722144508.GF19044@dan.emsphone.com> References: <00d501c8eafa$174daff0$3f83a8c0@neusofteaf5839> <1bd550a00807202332g69a71b66j8c985dc5f61e22e5@mail.gmail.com> <00e401c8eafc$bf4ef4a0$3f83a8c0@neusofteaf5839> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <00e401c8eafc$bf4ef4a0$3f83a8c0@neusofteaf5839> X-OS: FreeBSD 7.0-STABLE User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD , Fernando =?utf-8?Q?Apestegu=C3=ADa?= Subject: Re: How to change process status? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2008 14:45:14 -0000 In the last episode (Jul 21), EdwardKing said: > From: "Fernando ApesteguĂ­a" > > On 7/21/08, EdwardKing 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@allantgroup.com