[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] ldap problems fixed/need help with ldif script



> so, now we are stuck with a backup.ldif of users, that is full of the
> 
> > structuralObjectClass: inetOrgPerson
> > entryUUID: 6610afe4-0483-1027-9a9c-94a42655b8a5
> > entryCSN: 2003051416:53:37Z#0x0001#0#0000
> 
> entries.....does anyone have a script, or know of an easy way to look 
> for any lines starting with:
> structuralObjectClass:
> entryUUID:
> entryCSN:
> 
> and just delete them...?
> then we can use the ldapadd command above, and get our database squared 
> away...


Here are a couple possibilities using sed or awk:

cat backup.ldif |
sed -e /^structuralObjectClass/d -e /^entryUUID/d -e /^entryCSN/d



cat backup.ldif |
awk '{
  if ($0 !~ /^structuralObjectClass|^entryUUID|^entryCSN/)
    print;
}





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]