awk script that will convert such a line to an LDAP record in this format
Input line:Username:Firstname:Lastname:Telephone number
record output: dn: uid=Username, dc=example, dc=com cn: Firstname Lastname sn: Lastname telephoneNumber: Telephone number |
What is the question??
From the title, we can GUESS that you have some data that you want to convert to the format shown.---If so, then you need to show us what the data looks like. |
Input line:Username:Firstname:Lastname:Telephone number
|
Code:
awk -F: '{ print "dn: uid="$1", dc=example, dc=com" ; print "cn: "$2, $3 ; print "sn: "$3 ; print "telephoneNumber: "$4 ; print "" }' infile |
thanks druuna its worked
|
All times are GMT -5. The time now is 09:02 AM. |