From owner-freebsd-questions Thu Feb 15 17:56:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tomts7-srv.bellnexxia.net (tomts7.bellnexxia.net [209.226.175.40]) by hub.freebsd.org (Postfix) with ESMTP id 44D2337B491 for ; Thu, 15 Feb 2001 17:56:38 -0800 (PST) Received: from HSE-QuebecCity-ppp80890.qc.sympatico.ca ([64.229.234.63]) by tomts7-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010216015637.XLCW4700.tomts7-srv.bellnexxia.net@HSE-QuebecCity-ppp80890.qc.sympatico.ca>; Thu, 15 Feb 2001 20:56:37 -0500 Date: Thu, 15 Feb 2001 20:56:28 -0500 (EST) From: Felix-Antoine Paradis X-X-Sender: To: "Christopher W. Aiken" Cc: FreeBSD Questions Subject: Re: Shell Question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > How do I get the pid of the job I'm placing in the bg? > > The script is: mystuff {start|stop} > In mystuff I bg a job by: my_script & > > How do I get the PID of my_script so that I can use > it to kill the job when I: mystuff stop > > I'm looking for something like: PID=my_script & Use: PID_MY="`ps -U $USER |grep my_script |awk '{ print $1 }'`" It will do the job ______________________ Felix-Antoine Paradis reel@sympatico.ca PGP Key ID: 0x7B3AD2C5 -----BEGIN PGP SIGNATURE----- Version: PGP 6.5.8 iQA/AwUBOoyI1DBxB4d7OtLFEQJhEwCfcMMI6d6r0mEksSqHS5VtjLTftWcAnik8 8PalpetHpk1Q/sLMjE5SuL7c =Bf9n -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message