From owner-freebsd-questions Wed Sep 23 00:29:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA28292 for freebsd-questions-outgoing; Wed, 23 Sep 1998 00:29:59 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA28287 for ; Wed, 23 Sep 1998 00:29:55 -0700 (PDT) (envelope-from andre.albsmeier@mchp.siemens.de) X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer david.siemens.de) Received: from mail.siemens.de (salomon.siemens.de [139.23.33.13]) by david.siemens.de (8.9.1a/8.9.1) with ESMTP id JAA01916 for ; Wed, 23 Sep 1998 09:29:48 +0200 (MET DST) Received: from curry.mchp.siemens.de (daemon@curry.mchp.siemens.de [146.180.31.23]) by mail.siemens.de (8.9.1a/8.9.1) with ESMTP id JAA11744 for ; Wed, 23 Sep 1998 09:29:47 +0200 (MET DST) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.8.8/8.8.8) id JAA23361 for ; Wed, 23 Sep 1998 09:29:49 +0200 (CEST) From: Andre Albsmeier Message-Id: <199809230729.JAA12131@internal> Subject: How to get the PID before a program is run? (No joke :-) To: freebsd-questions@FreeBSD.ORG Date: Wed, 23 Sep 1998 09:29:47 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I have a rather curious problem here: I want to start a program but I need its PID before it is run. One way would be to load the program and send a -STOP signal very quickly. Then I have got the PID, can do some things and send a -CONT signal when finished. This is rather ugly. On my old Atari ST there was a function Pexec() which could be called with a special parameter which did all things in order to run a program but actually didn't pass control to it. I am sure there must be an esay way to do this on FreeBSD but I didn't find any. My preferred way of using it would be in a shell script but every hint is welcome. Thanks -Andre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message