Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dn: cn=testuser2@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- dn: cn=testuser3@nabc.com, ou=persons,ou=pp,dc=abc,dc=com
- dn: cn=testuser4@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- dn: cn=testuser5@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- dn: cn=testuser2@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- changetype: modify
- add: mail
- mail: testuser2@abc.com
- dn: cn=testuser3@nabc.com, ou=persons,ou=pp,dc=abc,dc=com
- changetype: modify
- add: mail
- mail: testuser3@nabc.com
- dn: cn=testuser4@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- changetype: modify
- add: mail
- mail: testuser4@abc.com
- dn: cn=testuser5@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- changetype: modify
- add: mail
- mail: testuser5@abc.com
- changetype: modify
- add: mail
- mail:
- sed -e 's/$/n changetype: modify n add: mail n mail:/' -i alluserdns.ldif
- dn: cn=testuser2@abc.com, ou=persons,ou=pp,dc=abc,dc=com
- changetype: modify
- add: mail
- mail:
- sed -e 's/.*cn=([^,]*).*/&nchangetype: modify nadd: mail nmail: 1/'
- awk '{print $0;match($2, /=(.*),/, arr); if(arr[1]!="") {print "changetype: modifynadd:mailnmail: " arr[1] }}' <input file>
Add Comment
Please, Sign In to add comment