Hi Guru's,
I am new to unix scripting. I have a huge file with user details in it(file2) and I have another file with a list of users(file1). Script has to search a user from file1 and get all the associated lines from file2.
Example:
fiel1:
cn=abc
cn=DEF
cn=xyx
File 2:
dn: cn=abc,ou=111,dc=111,dc=111,dc=com
uid: abc
userPassword:: lQ0E9sPsdfQ==
dn: cn=ghi,ou=111,dc=111,dc=111,dc=com
uid: ghi
userPassword:: PZHc9PsdfQ==
dn: cn=xyz,ou=111,dc=111,dc=111,dc=com
uid: xyz
userPassword:: PZHc9PsdfQ==
dn: cn=mno,ou=111,dc=111,dc=111,dc=com
uid: mno
userPassword:: PZHc9P23Q==
dn: cn=pqr,ou=111,dc=111,dc=111,dc=com
uid: pqr
userPassword:: PZHc9P23Q==
dn: cn=DEF,ou=111,dc=111,dc=111,dc=com
uid: DEF
userPassword:: PZHc9P23Q==
output file:
dn: cn=abc,ou=111,dc=111,dc=111,dc=com
uid: abc
userPassword:: lQ0E9sPsdfQ==
dn: cn=xyz,ou=111,dc=111,dc=111,dc=com
uid: xyz
userPassword:: PZHc9PsdfQ==
dn: cn=DEF,ou=111,dc=111,dc=111,dc=com
uid: DEF
userPassword:: PZHc9P23Q==
Thanks in advance for the help.
Sam