From owner-freebsd-questions@FreeBSD.ORG Sun May 31 19:40:22 2009 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 A1B7A106566B for ; Sun, 31 May 2009 19:40:22 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id D5C808FC1E for ; Sun, 31 May 2009 19:40:21 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [IPv6:::1]) by wojtek.tensor.gdynia.pl (8.14.3/8.14.3) with ESMTP id n4VJeDXr025821; Sun, 31 May 2009 21:40:13 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.3/8.14.3/Submit) with ESMTP id n4VJeDKa025818; Sun, 31 May 2009 21:40:13 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Sun, 31 May 2009 21:40:13 +0200 (CEST) From: Wojciech Puchar To: Kelly Jones In-Reply-To: <26face530905311117te38a4faya92733fbfebd9597@mail.gmail.com> Message-ID: References: <26face530905311117te38a4faya92733fbfebd9597@mail.gmail.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: Waiting for a process to die 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: Sun, 31 May 2009 19:40:23 -0000 > How do I wait for a specific process to die? I want to do something like: > > waitpid 1234&&(echo "done!" | Mail -s "PROC DONE" kelly.terry.jones@gmail.com) if i understand you correctly: your_program parameters & bg_process_number=$! ...something else... wait $bg_process_number echo "done!"