- 论坛徽章:
- 0
|
我的ldap数据格式如下:
dn: loginName=232356,o=commonUser,l=xm-broadman,dc=zmkun,dc=com
objectClass: top
objectClass: customer
category: Residential
cn:: 5p+v546J5Y2/
customerStatus: Active
loginName: 232356
userPassword:: e0NSWVBUfWE4R2k4S0Nid0VwNmM=
dn: serviceCode=VOD0001,loginName=232356,o=commonUser,l=xm-broadman,dc=zmkun,dc=com
objectClass: top
objectClass: subscription
endDate: 201612311010Z
profile: 1024kVOD
serviceCode: VOD0001
serviceStatus: Active
startDate: 200709111631Z
dn: serviceCode=Internet,loginName=tianxiangyun,o=commonUser,l=xm-broadman,dc=zmkun,dc=com
objectClass: top
objectClass: subscription
endDate: 201612311010Z
profile: 1024kInternet
serviceCode: Internet
serviceStatus: Active
startDate: 200806211326Z
我现在想得到loginName后面的用户名如:232356,tianxiangyun(若有多个匹配,只取一个)
从得到的用户名生成如下格式的文件:
232356@zmkun.com 232356/
tianxiangyun@zmkun.com tianxiangyun/
中间空格或者TAB都可以
希望兄弟们帮忙一下,有点小急,简单的sed会一点点,这个对偶来说难度有点小大了 |
|