【发布时间】:2017-07-09 11:51:25
【问题描述】:
我是 linux 新手,不知道如何解决我的问题。我有这样的输出(大约 200 行):
Peter Griffin
222
Vasya Pupkin
333
我需要将其转换为:
222, Peter Griffin
333, Vasya Pupkin
我试过了
ldapsearch -LLL -D $bindDN -w $password -p $port -h $host -b $searchBase -S "telephoneNumber" -s sub cn telephoneNumber | grep -v "dn: " | grep "\\n" | awk -F": " '{ print $2 }'
我怎样才能意识到这一点?
【问题讨论】:
-
请展示您的编码工作。
-
ldapsearch -LLL -D $bindDN -w $password -p $port -h $host -b $searchBase -S "telephoneNumber" -s sub cn 电话号码 | grep -v "dn:" | grep "\\n" | awk -F": " '{ 打印 $2 }'
-
在此之后,我有一个类似线程的输出