Answer the question
In order to leave comments, you need to log in
How to cut certain lines in command output?
dn: uid=user,ou=exempl,dc=org,dc=local
cn:: 0JDQvdCw0YLQvtC70LjQu
sn:: 0JDQvdC
givenName:: 0JDQvdCw
description:: 0KHQuNGB0YLQtdC80Lww0YLQvtGA
uid: user
loginShell: /bin/bash
uid333: shadowNumber
:
43 @ mail user
gosaMailDeliveryMode: []
gidNumber: 5000
HomeDirectory: / home / user
the userPassword :: FEegflrrhlhfdeffetbvgrt the
objectClass: the inetOrgPerson the
objectClass: the organizationalPerson
sshPublicKey: the ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3F2wh9fq8SSdehtEfrtg
RAI2LqVIy4YYBQZSC5TXcyGJg8fiOWupooeJIXSFbeDilIrvEju0htfXfn2WzTn93 ++ lnoTKOvo82
RIhADmUyrZKd1vuZhVbqRQICEID3kxuoM47igHykMlW11kZhuh07+xw1y2B5yLlMqjc6tqBqZRVB1
0iNXbIud [email protected]
# search result
search: 2
result: 0 Success
How to strip the output of the sshPublicKey:... command? With awk or sed
Answer the question
In order to leave comments, you need to log in
sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp'
And in ldapsearch
or what do you output there, you did not think to use the filter of output parameters?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question