I want a shell script that reads a specific attribute value from an ldapsearch result
I am trying to write a script that finds the checks homefolder quotas, and sends emails to users who are exceeding a certain percentage of their quota, we have 389 ldap server, I can search the ldap for a uid, and the result is in ldif format. I can not figure out how to read the value of the attribute corresponding to email, lets say personalEmail: hisEmail I want to read the value of the personalEmail attribute开发者_C百科, i.e. hisEmail
thanks
ldapsearch ... | awk -F ": " '$1 == "desiredAttribute" {print $2}'
精彩评论