Changes
/* Search an replace - Replace a section (part) of an attribute - Step by step */
We need to create an array of the the complete result:
<source lang='bash'>
-H "$ldap_server" \
-b "$ldap_base" \
-D "$ldap_bind_account" \
-w "$ldap_bind_password" \
"(${ldap_attribute}=*${ldap_attribute_old}*)" \ | awk '{ if (/^ /) { sub(/^ /, ""); } else printf "\n"; printf "%s", $0 }' \ | awk '/^dn: / { print $2 }'
)
</source>
Finally, we need to loop over all the distinguished names and replace the original (old) content to the attribute with the new content:
<source lang='bash'>
for dn line in $childrenresult
do
done
</source>