[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash, expressions, ???



"Egor Tur" <worldeb@ukr.net> writes:

> Hi.
> Who can explain?
> ps ax | grep lpd
>   398 ?        S      0:00 lpd Waiting  
>  5593 pts/13   S      0:00 grep lpd
> ps ax | grep [l]pd
>   398 ?        S      0:00 lpd Waiting
>
> What do [l]?

As far as grep is concerned, [l] is a regular expression that matches
any single character that is a lowercase l.  lp[rd] would match either
lpr or lpd.  The important effect here is that lpd and [l]pd both
match 'lpd', but neither matches '[l]pd', so the grep process itself
isn't included in the ps listing.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: