Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Nov 2011 16:37:06 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        Mark Saad <nonesuch@longcount.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: What is going on with ash / sh
Message-ID:  <CAFMmRNziiMbD8FS_868bfPCBBFOUkKOd%2BxS=A%2BAwkVEhPEiyBQ@mail.gmail.com>
In-Reply-To: <CAMXt9NYcO4JsZRUr_TVzoE08F7hyED4EUM5RBH2w6gC5_NSe5Q@mail.gmail.com>
References:  <CAMXt9NYcO4JsZRUr_TVzoE08F7hyED4EUM5RBH2w6gC5_NSe5Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 2, 2011 at 4:28 PM, Mark Saad <nonesuch@longcount.org> wrote:
> Hackers
> =A0What is going on here, if I run the following shell script, what is
> the expected output . The script is named xxx
>
> #!/bin/sh
> ps -ax | grep -v grep | grep xxx
>
> Here is what I see
>
>
> =A0# sh xxx
> 88318 =A0p0 =A0S+ =A0 =A0 0:00.00 sh xxx
> 88320 =A0p0 =A0R+ =A0 =A0 0:00.00 sh xxx
> 88321 =A0p0 =A0R+ =A0 =A0 0:00.00 sh xxx
>
>
> Can someone explain this ?

ps is happening to run after sh has forked off the two grep processes
but before they exec'ed grep?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNziiMbD8FS_868bfPCBBFOUkKOd%2BxS=A%2BAwkVEhPEiyBQ>