Hi,

Narayana Yaddanapudi typed:
> As a follow up, the first invocation of grep in a session always shows
> the output. Any later invocation doesn't, even if it is some time later.
> -------------snip--------------
> [narayana@bloom narayana]$ date; ps -aux | grep grep
> Tue Jul  4 06:35:22 IST 2000
> narayana  1269  0.0  0.8  1360  508 tty1     S    06:35   0:00 grep grep
> [narayana@bloom narayana]$ date; ps -aux | grep grep
> Tue Jul  4 06:35:34 IST 2000
> [narayana@bloom narayana]$ date; ps -aux | grep grep
> Tue Jul  4 07:40:21 IST 2000
> [narayana@bloom narayana]$
> -------------snip--------------

The only explanation I can come up with, is that the first time, ps
has to get loaded from disk, etc so it is slow. So meanwhile grep is
also started, and the output of ps is connected to the input of grep.
Now when ps is running, it finds grep and prints out the PID of grep.
The second time, everything is already in memory, so ps runs really
fast, and the output gets buffered, *before* grep can even run. Thus,
ps does not display a line for grep.

#include <std_disclaimer.h>

I have no proof of what I have stated above.

-- 
Mrinal Kalakrishnan <[EMAIL PROTECTED]> http://mrinal.dhs.org/
Linux 2.2.12-20 || PGP:B1E86F5B || Mutt 1.2i (2000-05-09) || VIM 5.6 
-- 

-----------------------------------------------------------------------
For information on this and other Linux India mailing lists check out
http://lists.linux-india.org/

Reply via email to