Openldap Experts

Robert L Cochran cochranb at speakeasy.net
Mon Dec 10 02:00:07 UTC 2007


Robert L Cochran wrote:
> Cameron Simpson wrote:
>> On 09Dec2007 15:17, Stuart Sears <stuart at sjsears.com> wrote:
>> | 1. which (uncommented) lines are in /etc/ldap.conf at the moment?
>> | egrep -v '^($|#)' /etc/ldap.conf
>>
>> OT - grep curiosity...
>> You can embed a "$" inside an alternation?
>>
>> Personally, I've always used:
>>
>> grep '^[^#]'
>>
>> for this task.
>>
>> Cheers,
> This:
>
> egrep -v '^($|#)' /etc/ldap.conf
>
> matches any line which is not blank and does not have an octothorpe in 
> it. It is not negating a character class which is what you put inside 
> brackets [ ]. It is negating the start of a line or the octothorpe 
> '#'. That leading caret ^ negates each alternative within the 
> parentheses.
>
> Bob Cochran
>
No, I'm wrong -- I put my foot in my mouth here. I should have checked 
on the -v option for egrep first. It inverts the sense of the match. And 
the '$' anchors the end of a line, not the start. I need to give this 
one more thought....

Bob




More information about the fedora-list mailing list