[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldapsearch result breaks the long dn's in seperate lines

Previously, Abhishek Srivastava wrote:
> I am using ldapsearch method to backup the data and writing the output to
> some file. If the dn of any object is too long then the same is broken into
> two lines. Is there any option to suppress this new line character for long
> DN's.

No, but if you're really desperate you can post-process it with Perl or
something (I've had to do this):

    while (<>) {
        if (/^ /) {
            s/^ //;
            $currline .= $_;
        } else {
            $currline = $_;

Run like this:

    ldapsearch [...args...] | perlscript > new-ldif-file

Or as someone else pointed out, use the Netscape SDK.

It's been said that a million monkeys at a million keyboards could produce
the complete works of Shakespeare; now thanks to the Internet, we can say
that this is not true.