//View Tip #234
Similar Tips
» Mass-renaming files
» MAC address conversion
» Calendar with current date
» Duplicate directory tree
» Copy and paste from the command line

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
I'm working on a project to access data from my corporate Active Directory server using ldapsearch. The version of ldapsearch that comes with Red Hat Enterprise Server spews out LDIF in column truncated format. That is to say it inserts a carriage return at column 80 of the output.

This sed goodie unwraps the ldif output.

UNWRAP=' /^ / {; H; d; }; /^ /! {; x; s/\n //; }; '


View Comments »



Comments 

Add your comment

Comments are currently disabled
Gene
I think if this sed code had been wrapped in a preformatted block, then this expression would work. As it is it doesn't though.
Posted 2008-12-12 22:37:47
Gene
Here's an alternative to the sed line above which fails :

perl -p0e 's/\n //g'
Posted 2008-12-12 22:56:08

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit