I use slapcat to do a full-text search in our very large ldap directory. As it is easier to match what I am looking for when I don't know where to look.

The problem is that it wraps long lines

slapcat -v | grep -A 1 "some search string"
 wraps like this

I found a solution to this from this answer https://stackoverflow.com/a/10002241/619760

This matches line ending \n followed by a and joins the lines.

slapcat -v | grep -A 1 "some search string" | sed '$!N;s/\n //;P;D'
somelongvar::linesoftesttext12345667890987654321234567887654321234567897654321wraps like this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.