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

Re: making ldapsearch not to split lines

On Wednesday 15 November 2006 16:44, Hai Zaar wrote:
> I have bash script that does this:
>   hostDN=( $(ldapsearch .... | grep '^dn' | cut -d ' ' -f 2) )
> The problem is that if the 'dn' line is too long, ldapsearch splits it
> to several lines according to LDIF rules.

If I need to do something like this on the shell, I typically use something 

ldapsearch|perl -p0e 's/\n //g'|awk -F: '/^dn/' '{print $2}'

> Is there any way to tell ldapsearch not to split lines (or does it
> depends on server side?)

Not at present, some patches were proposed in some ITSs, but no agreement was 
reached on their usefulness (IIRC).


Buchan Milne
ISP Systems Specialist - Monitoring/Authentication Team Leader

Attachment: pgpwGKJKBIU9B.pgp
Description: PGP signature