I'm trying to figure out a way of counting how many attribute values (for a multi-valued attribute in LDAP) various different users have. For example, the data looks something like this...
dn: [email protected],ou=test,dc=acme,dc=com accountid: a45ff948-e154-4c48-aa74-5b64ea876735 dn: [email protected],ou=test,dc=acme,dc=com accountid: f8103174-7853-4b0c-8d0e-faa820c8eff8 accountid: 3bea64d3-98d5-4ff1-b654-d01e4e3128cd dn: [email protected],ou=test,dc=acme,dc=com dn: [email protected],ou=test,dc=acme,dc=com accountid: 90ad7323-20ca-4087-9b13-62d5713ae57e I'd like to have output along the lines of...
[email protected],ou=test,dc=acme,dc=com , 1 [email protected],ou=test,dc=acme,dc=com , 2 [email protected],ou=test,dc=acme,dc=com , 0 [email protected],ou=test,dc=acme,dc=com , 1 Or at the very least I'd just like to know (and print out) which DNs have multiple values for the accountid attribute.
Any ideas please?
Thanks in advance!