perl finds bug in fgrep(1)!

Roger Collins rogerc at ncrcae.Columbia.NCR.COM
Mon Aug 29 22:58:35 AEST 1988


In article <842 at yabbie.rmit.oz> rcodi at yabbie.rmit.oz (Ian Donaldson) writes:
>
> Its a race condition: fgrep doesn't get started by the shell until
> ps does, so ps sometimes completes before fgrep is started.
> 
> If you repeat your second example a few times you will eventually see
> some output.

Not necessarily, Ian.  In all releases of the TOWER 32 4xx/6xx until the
current 2.00.00, the -f option of ps(1) does not print the arguments of 
a process if argc is invalid.  A lot of commands invalidate argc by
decrementing it during command-line parsing.  My guess is fgrep decrements
argc, grep doesn't.  That simple.

--
Roger Collins
NCR - E&M Columbia
TOWER Uniprocessing Systems
rogerc at ncrcae.Columbia.NCR.COM



More information about the Comp.unix.wizards mailing list