(forgot to reply to the list)
Ulrich Windl Ulrich.Windl@rz.uni-regensburg.de schrieb am 06.02.2017 um
08:14 in Nachricht 58983099.ED38.00A1.0@rz.uni-regensburg.de:
"Ralf Mattes" rm@mh-freiburg.de schrieb am 01.02.2017 um 17:23 in
Nachricht
45d3-58920b80-2b-2963e90@255443456:
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.
Zwo questions:
1: Doesn't /^dn:/ also match "dn::" (likewise /^cn:/ and "cn::"? 2: If /^cn:/ matches "cn::", wouldn't the sub() replace "cn::" with "displayName::"?
So everything would still work IMHO.
We don't use displayName like that; we only us it if someone with an academic title insists on having his "Prof." or "Dr." (or any collection of
that in his/her name).
Regards, Ulrich
Thought of the day: Trump vs. America; who will win?
Cheers, Ralf Mattes
regards, Jephté