From: Alistair McKeown (Alistair.Mckeown@jacobsrimell.com)
Date: Thu Jul 21 2005 - 03:39:26 EDT
Hi there,
I have two files one of which is an ldif and the other is a
list of usernames,
1st file, this is an ldif deleting file containing peoples email aliases
which I wish to delete, each persons block is separated by a blank line :-
dn:
configuredItemName=1115204860,organizationalUnitName=intermailMXSupplement
,organizationalUnitName=mail,ou=uscos,ou=amsterdam,ou=domains,ou=nl,ou=domai
ns,o=chello
changeType: modify
delete: reservedEmailAlias
reservedEmailAlias: h.smith
dn:
configuredItemName=111181205590,organizationalUnitName=intermailMXSuppleme
,organizationalUnitName=mail,ou=uscos,ou=amsterdam,ou=domains,ou=nl,ou=domai
ns,o=chello
changeType: modify
delete: reservedEmailAlias
reservedEmailAlias: s.bloggs
dn:
configuredItemName=1100120160,organizationalUnitName=intermailMXSupplement
,organizationalUnitName=mail,ou=uscos,ou=amsterdam,ou=domains,ou=nl,ou=domai
ns,o=chello
changeType: modify
delete: reservedEmailAlias
reservedEmailAlias: c.denton
2nd file - This contains a list of email aliases I wish to keep and all of
which will be somewhere in the 1st file.:
S.bloggs
I want to be able to look at the 2nd file, take the email alias, match it
somewhere in the 1st file then delete the whole block. So the output would
now be :
dn:
configuredItemName=1115204860,organizationalUnitName=intermailMXSupplement
,organizationalUnitName=mail,ou=uscos,ou=amsterdam,ou=domains,ou=nl,ou=domai
ns,o=chello
changeType: modify
delete: reservedEmailAlias
reservedEmailAlias: h.smith
dn:
configuredItemName=1100120160,organizationalUnitName=intermailMXSupplement
,organizationalUnitName=mail,ou=uscos,ou=amsterdam,ou=domains,ou=nl,ou=domai
ns,o=chello
changeType: modify
delete: reservedEmailAlias
reservedEmailAlias: c.denton
Where the whole block of s.bloggs has been deleted. I don't know how to go
about this, I'm sure it can be done in perl somehow. I'm sure there is a
perl guru out there somewhere. I appreicate this isn't a direct system
question, but there seems to be so many system administrator who are perl
gurus as well!
Kind regards,
Alistair.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:31:09 EDT