[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Script for mass updates
- To: "Jephte Clain" <jephte.clain@univ-reunion.fr>
- Subject: Re: Script for mass updates
- From: "Ralf Mattes" <rm@mh-freiburg.de>
- Date: Wed, 01 Feb 2017 17:23:45 +0100
- Cc: Nick Milas <nick@eurobjects.com>, Michael Ströder <michael@stroeder.com>, openldap-technical@openldap.org <openldap-technical@openldap.org>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mh-freiburg.de; s=mail; t=1485966227; bh=PTm7k+nE9gq66goEfpKbbU2GtNDXSrJeeWUnuY51RrM=; h=in-reply-to:to:from:subject:date:cc:From; b=PipQ14fAqQN3CrBa0u9xCeP54+61EopUjWBJY+xCKsHj/YH46k2A8DGNzLGXjbh/0 sO8RiIa2CGlQO1ZUstfyJS5JbITVFbKF6Oqf+ltrOZjfx4x2ESB6q+RqNYtSlseEa1 HbaE7lpjDO+dQ/dryjGolUw+w1ABN8Zlo1A02oOE=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mh-freiburg.de; s=mail; t=1485966224; bh=PTm7k+nE9gq66goEfpKbbU2GtNDXSrJeeWUnuY51RrM=; h=in-reply-to:to:from:subject:date:cc:From; b=Dn61X8lM4J1/gF3Ujk1WrHa1jJgLylvhdquo/MxhWuBHSvYyO5hn69AJ1X1okgUC+ tdjTm9FciRA969ZytqYwO5oywVGRjTPSc2g03FtnYdGlkC5M2eytK7md1wAWZ20k0H IiFHiud+IJMRkVqFnFVSdmjgu0qs2EuW0jF8J8uw=
- In-reply-to: <CAPas2jScEuS36kUrHGfj8ihUGM0=JPUCf1jeYS52+Uu36BsKyQ@mail.gmail.com>
- User-agent: SOGoMail 2.3.17
Am Mittwoch, 01. Februar 2017 16:52 CET, Jephte Clain <jephte.clain@univ-reunion.fr> schrieb:
> using michaël's filter, you could try this:
>
> ldapsearch [options] '(&(ou:dn:=people)(!(ou=system))(!(displayName=*)))'
> cn | awk '
> /^dn:/ {
> print
> print "changetype: modify"
> print "replace: displayName"
> next
> }
> /^cn:/ {
> sub(/^cn/, "displayName")
> }
> { print }
> ' | ldapmodify [options]
>
> we aren't doing your homework, are we? :-)
Danger, Will Robinson!
This will only work for dn values that aren't encoded.
That's a trivial job for perl or python (or whatever). AWK operates
on character streams and that's a bad fit for LDIF.
Cheers, Ralf Mattes
> regards,
> Jephté
>