From owner-freebsd-questions Mon May 15 14:49:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.exoffice.com (host102.ridgeventures.com [207.33.160.102]) by hub.freebsd.org (Postfix) with ESMTP id 6A93337B7FC for ; Mon, 15 May 2000 14:49:17 -0700 (PDT) (envelope-from boisvert@exoffice.com) Received: from exoffice.com (fwin.exoffice.com [207.33.160.97]) by mail.exoffice.com (8.9.3/8.9.3) with ESMTP id OAA24550 for ; Mon, 15 May 2000 14:49:17 -0700 Message-ID: <39206FEF.226AE171@exoffice.com> Date: Mon, 15 May 2000 14:45:19 -0700 From: Alex Boisvert X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 i686) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: PID of a forked process Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I have a basic BASH-related question. How does one obtain the PID of a forked process in bash? Here's what I'd like to do: #!/usr/local/bin/bash while test 1 do PID = some_long_process & sleep 60 kill -9 PID done I'm going to use this script in a test framework where I need to test an application for recoverability. So I want to start the application, wait for a given amount of time and then kill this application and repeat. So how to I obtain the PID of a process which is forked? I've tried %% but it didn't work. regards, alex. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message