Openldap Experts

Robert L Cochran cochranb at speakeasy.net
Mon Dec 10 01:42:49 UTC 2007


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 





More information about the fedora-list mailing list