From owner-freebsd-questions@FreeBSD.ORG Sun May 31 18:29:03 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 0AC5C1065674 for ; Sun, 31 May 2009 18:29:03 +0000 (UTC) (envelope-from utisoft@googlemail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 8668C8FC0A for ; Sun, 31 May 2009 18:29:02 +0000 (UTC) (envelope-from utisoft@googlemail.com) Received: by bwz9 with SMTP id 9so7237757bwz.43 for ; Sun, 31 May 2009 11:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=CzOqlE639S1zhsLWR28sB78xHy7e+Syeq7Y0fGSfnac=; b=K33152eQepo6rQnq05oOXIM8wimlu5I8m1HLZN4wcVcLJawECKXyBRIWo3KfPsqTCc lZz96AGKAZ58EYYhKE/+9kllXIxfxV31BVa+Q9zzriZeU0FHkKOaymEZlZ44NMe+IwTr MgO1MxQVpfU0BmD7S7yzVPU0e/9eTjYnHRwnE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=KxWNf2tXWOr2ZHzMYrh1fLS4KXsHts7ZSA1u4w4/3m9XMswSqmrZW9pBMbivJkGk8b YOvXwS7a5KO/r1u3AuwdzMSYLkVXJt/f1kc/jnHslKXA13jouobMoovzDsN/5UQ3TUnk w+XNaBtux6UPzQaNnNIFJv3EUYyIXSt9gcQvc= MIME-Version: 1.0 Received: by 10.204.117.142 with SMTP id r14mr4796750bkq.197.1243794541126; Sun, 31 May 2009 11:29:01 -0700 (PDT) In-Reply-To: <26face530905311117te38a4faya92733fbfebd9597@mail.gmail.com> References: <26face530905311117te38a4faya92733fbfebd9597@mail.gmail.com> From: Chris Rees Date: Sun, 31 May 2009 19:28:41 +0100 Message-ID: To: Kelly Jones Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 Reply-To: utisoft@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 18:29:03 -0000 2009/5/31 Kelly Jones : > 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) > > I'm sure this is trivial, but I can't find a way to do it. > > I wrote a Perl script that checks every second if /proc/pid exists, > but that only works if /proc is mounted + I'm now on VMs which can't > easily mount /proc > > -- > We're just a Bunch Of Regular Guys, a collective group that's trying > to understand and assimilate technology. We feel that resistance to > new ideas and technology is unwise and ultimately futile. [ `ps ax |grep pid | wc -l ` = 1 ] && (echo "done!" | Mail -s "PROC DONE" kelly.terry.jones@gmail.com) Chris -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in a mailing list?