I'm new to linux and don't know how to solve my issue. I have an output like this (about 200 lines):
Peter Griffin
222
Vasya Pupkin
333
I need to convert this to:
222, Peter Griffin
333, Vasya Pupkin
I tried
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 }'
How can I realize it?