From owner-freebsd-questions Mon May 15 14:59:23 2000 Delivered-To: freebsd-questions@freebsd.org Received: from houston.matchlogic.com (houston.matchlogic.com [205.216.147.127]) by hub.freebsd.org (Postfix) with ESMTP id 9D6D237B555 for ; Mon, 15 May 2000 14:59:15 -0700 (PDT) (envelope-from crandall@matchlogic.com) Received: by HOUSTON with Internet Mail Service (5.5.2650.21) id ; Mon, 15 May 2000 15:59:12 -0600 Message-ID: <5FE9B713CCCDD311A03400508B8B3013B257E1@bdr-xcln.is.matchlogic.com> From: Charles Randall To: Alex Boisvert , freebsd-questions@freebsd.org Subject: RE: PID of a forked process Date: Mon, 15 May 2000 15:59:10 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG No offense, but RTFM via "man bash". I believe "$!" is what you're looking for. -Charles -----Original Message----- From: Alex Boisvert [mailto:boisvert@exoffice.com] Sent: Monday, May 15, 2000 3:45 PM To: freebsd-questions@freebsd.org Subject: PID of a forked process 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message