Sorting problem.

2007-12-25 5:05:00

Hi there,

I have two files on a Solaris machine,

One file containing a list MAC addresses that I want to delete in a
directory :

00:00:CA:3A:D7:FD
00:00:CA:BD:89:F1
00:00:CA:BE:6A:81
00:00:CA:BE:E6:D5
00:00:ca:25:7c:6e
00:00:ca:25:9f:1e
00:00:ca:25:a6:89
00:00:ca:25:a9:8f

One file contain an ldapsearch output :

dn:
commonName=201407120,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=c
hello
uscoLink5: 00:00:CA:3A:D7:FD
uscoLink5: 00:13:11:21:7d:36
version: 1
dn:
commonName=300729740,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=c
hello
uscoLink5: 00:00:CA:BD:89:F1
uscoLink5: 00:13:11:00:33:55

What I need to be able to do, is to match the effective MAC address from the
1st file, match it to the 2nd and then produce an ldif like the 2nd file but
only contains the relative mac address that needs to be deleted. Trouble is
a lot of users have more than one mac address coming back from an
ldapsearch.

So the ideal output would be :

dn:
commonName=201407120,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=c
hello
uscoLink5: 00:00:CA:3A:D7:FD
version: 1
dn:
commonName=300729740,ou=users,ou=amsterdam,ou=domains,ou=nl,ou=domains,o=c
hello
uscoLink5: 00:00:CA:BD:89:F1

Where the Mac address in the first file has been matched to one of the two
mac addresses in the 2nd.

I appreiate this isn't a direct solaris O/S question, but I know there is a
lot of Perl gurus out there who are Solaris system administrators as well,
who have been so helpful in the past. And this is a stopping point for me at
the moment.

Kind Regards,

Alistair Mckeown.

Comments

Got something to say?

You must be logged in to post a comment.