I am a new bie in perl. I have to generate LDIF files
after reading a file containing a list of userids of a new admitted
batch of a university along with their passwords, uidNUmber And
gidNumber. Say the new batch contains 400 students, and the uidNumber
starts from the number 2631 onwards. So for each new userid read from
the file (it contains the userids and their respective MD5 password), a
new LDIF file has to be generated. The LDIF file format for a student
Here the lines which should be updated are the first line, where the
uid=uid=s08-1-5-097, is to be filled up for every new uid read from the
The second line is to be updated with the uid read from the input file.
The third line is to be updated with the uid for value of cn:
Lines 4-7 are not to be changed for anything. They would remain same as shown above.
The line 8's userPassword has to be updated after the MD5 passoword corresponding to each uid.
Line 6 would remain same for all the files. Nothing to be changed.
uidNumber and gidNumber would be same for a stundent and should be incremented for the nest
The home directory should be as: /mnt/btech/value of uid
where the uid's value is read from the input file, for example it is here->s08-1-5-097
for all the files it would be different as uid is different for each student. This would be their home directory.
9) The lines below the line of homedirectory would remain same for all the files.
Please provide me the perl script for that. I am just a new bie and would take weeks to write the script for doing that.
A sample student file of five students is as given below (in the format of uid, MD5 password) as below:-
Now please generate five LDIF files in the format as shown above for each
uid after reading fro the input file of five students :-