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

Re: grep question



Johann Spies <jspies@sun.ac.za> writes:

> In the grep's info page I find the following which works as said.
> But I want to know why. What does the [c] do in this case?
[...]
>           ps -ef | grep '[c]ron'

It defines a character class containig a "c" as it's only member. The
expression "[cp]ron" would match "cron" as well as "pron", whereas
"[cp]r[o0]n" would also match "pr0n" (and "cr0n").

Get enlightened - type `man 7 regex`.

[x] ulf

-- 
Die drei Feinde des Programmierers:
Sonnenlicht, Frischluft und das unerträgliche Gebrüll der Vögel


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: