in reply to Re: Reformat command output inline
in thread Reformat command output inline

Thank you, this not only does what I need but also helps me understand syntax better. Just one more question, if you don't mind. I understand why newline should be at the end of the dn: line now (e.g. first line) but why empty line also can't be like that?

Replies are listed 'Best First'.
Re^3: Reformat command output inline
by choroba (Cardinal) on Jun 29, 2016 at 13:56 UTC
    It can, i.e. you can start the regex with s/^\n| , but it doesn't change the output. Moving the newline to the end for the dn: line was essential to make it work for the first record.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      I see, I have to remove endline $. Well, it was more regex question. Thanks again for taking time to answer.