perl finds bug in fgrep(1)!

Ian Donaldson rcodi at yabbie.rmit.oz
Fri Aug 26 17:43:17 AEST 1988


>From article <458 at tauros.UUCP>, by treval at tauros.UUCP (Trevor Luker):
> 	try the following (On NCR Tower SysV.2):-
> 
> 	$ ps -ef | grep xxxxxx
> Gives->	treval  8911  8910  4 13:12:01 X00t  0:00 grep xxxxxx
> 	$ ps -ef | fgrep xxxxxx
> Gives->	$
> 
> 
> 	Is this a related problem to the grep(1) bug? 

No, no bugs here at all.

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.

Ian D



More information about the Comp.unix.wizards mailing list