Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 May 2000 14:25:30 +0100
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        Nicolas Perreten <freebsd@webhosting.com>
Cc:        "Olivier Cortes (ML)" <receiver@deep-ocean.net>, Alex Boisvert <boisvert@exoffice.com>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: PID of a forked process
Message-ID:  <20000516142530.E10128@strontium.scientia.demon.co.uk>
In-Reply-To: <Pine.BSF.4.10.10005151910240.10518-100000@livid.webhosting.com>
References:  <EJEFLAEIHOBBKCGOKMJJMEFFCDAA.receiver@deep-ocean.net> <Pine.BSF.4.10.10005151910240.10518-100000@livid.webhosting.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Nicolas Perreten wrote:

> With the above, you risk reading the PID of the grep process..
> 
> ps ax | grep "my_process" | grep -v grep | cut -c1-6  is a better bet.

ps ax | awk '/[m]y_process/ { print $1 }' is even better since you only
use two processes instead of four. :-)

-- 
Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D


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?20000516142530.E10128>