Date: Wed, 23 Sep 1998 12:57:49 -0500 From: Dan Nelson <dnelson@emsphone.com> To: Studded <Studded@dal.net> Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>, freebsd-questions@FreeBSD.ORG Subject: Re: How to get the PID before a program is run? (No joke :-) Message-ID: <19980923125749.A26376@emsphone.com> In-Reply-To: <360931B1.29E98E12@dal.net>; from "Studded" on Wed Sep 23 10:36:49 GMT 1998 References: <199809230729.JAA12131@internal> <19980923095428.B10645@emsphone.com> <360931B1.29E98E12@dal.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Sep 23), Studded said: > Dan Nelson wrote: > > > How about: > > > > #! /bin/sh > > echo $$ > /var/run/program.pid > > $$ is the pid of the shell. > > Doug You left out the rest of my script :) #! /bin/sh echo $$ > /var/run/program.pid exec /bin/program The exec replaces the shellscript with the program. The pid does not change. I did test the script before posting the message ya know :) -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980923125749.A26376>