I think this (from previous comment) should be in the ldap-utils faq. "If you want play with shell and ldapsearch output, be sure your dn entries are one per line. An perl script could be: ldapsearch ... | perl -p -0040 -e 's/\n //'" Regards,