Hi everyone.
I have a bunch of files like the following one:
Code:
dn: Identifier=3AM9,c=MX,l=world
objectclass: top
objectclass: IRPerson
uid: user1@mail.com
c: MX
ispasswordexpired: false
passwordlastchangedatetime: 20130211195022
userPassword: {SHA}fGphxo74ubawYbKMNIvB7Xkhy1M:
businesscategory: 1
Identifier: 3AM9
sn: last
cn: user1 last
mail: user1@mail.com
i need to change last character from userPassword : to =
e.g.
Code:
userPassword: {SHA}fGphxo74ubawYbKMNIvB7Xkhy1M=
so far i'm only able to change the first :
Code:
$ sed '/userPassword/s/:/=/' file.ldif
dn: Identifier=3AM9,c=MX,l=world
objectclass: top
objectclass: IRPerson
uid: user1@mail.com
c: MX
ispasswordexpired: false
passwordlastchangedatetime: 20130211195022
userPassword= {SHA}fGphxo74ubawYbKMNIvB7Xkhy1M:
businesscategory: 1
Identifier: 3AM9
sn: last
cn: user1 last
mail: user1@mail.com
Any idea?, btw, userPassword can be at the top/middle of botton of the file.