A 13:03 18/01/2001 -0500, vous avez écrit :
>
>  try
>
>       $ ps -ef | grep [n]tpd
>
>why this works is left as an exercise for the hacker.

when you do a "grep ntpd" you will get a process which will show as "grep
ntpd" in the ps process list
thus when grep actually processes this list it will pick up the line(s)
concerning the ntpd process(es) if any, AND the line concerning the grep
process itself.
if you do a "grep [n]tpd" the grep process will show as "grep [n]tpd"
(because ps displays the arguments as entered) but the grep command will
only pick up lines containing "ntpd" (which is the only possible match for
the regular expression "[n]tpd" hence not picking up it's own line

this is funny, but 

ps -ef | grep ntpd | grep -v grep

is much cleaner in my opinion

hth,

                        - * - * - * - * - * - * -
Mes idees n'engagent que moi (vieux proverbe du Net)

Thierry ITTY
eMail: [EMAIL PROTECTED]                FRANCE



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to