Sort attributes by name for each entry in ldapsearch output (ldap database export)
I need to sort attributes by name for each entry in ldapsearch output
(-S "" sort entries by name, but not their attributes) I need this to compare consistency of 2 ldap databases after the wan connection link up (in multimaster configuration). Because the time of writing for each attribute could differ, the order could not be the same. My "export" script HOSTNAME=localhost BINDDN="cn=manager,dc=example,dc=com" BASE="dc=example,dc=com" PASSWORD=`cat /etc/ldap.secret` /usr/bin/ldapsearch -LLL -x -h $HOSTNAME -D "$BINDDN" -w "$PASSWORD" -b "$BASE" -S "" Thanks in advance. Leandro. |
Could not find it either. Ended up with brute force solution with sorting within sections of ldapsearch output like:
/usr/bin/ldapsearch -LLL (...) | sort_within_sections.sh where sort_within_sections.sh looks like: Quote:
Regards Remigiusz Boguszewicz |
All times are GMT -5. The time now is 12:56 AM. |