Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: array with newlines preserved as literal text



On 2021-02-02 11:26 a.m., Roman Perepelitsa wrote:

This is fine. You can verify that the content is as expected:

     print -r -- $array2
Bloody hell, it was the missing '-r' there :(  the array was fine, just improper output.  Past time I knew that.

Use `typeset -p var` to see the value of parameter `var`.

     typeset -p array2
Thanks I knew there was something like that but I forgot it.  That's what happens when I don't code for over a year, I forget everything.  I've been busy columnizing grep output.  the 'column' command doesn't quite do it because it takes all those '\n' that you might find in code literally which is why I had to sort that out.

|$ g ,w4 'msg "\n' g,* ||
||
||g,32,pplain in place......................120.. ! [ "$pplain" ] && actionmsg "\n$msg"|| ||g,32,pplain in place......................168..    ! [ "$pplain" ] && actionmsg "\n$msg"|| ||g,33,better formatting and fix rregexp....121.. ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,33,better formatting and fix rregexp....169..    ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,34,light edits..........................104.. ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,34,light edits..........................152..    ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,35,interim..............................106.. ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,35,interim..............................154..    ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,36,g_column in place interim............107.. ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,36,g_column in place interim............155..    ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,37,g_columns in place and looks good....108.. ! [ "$bbare" ] && actionmsg "\n$msg"|| ||g,37,g_columns in place and looks good....156..    ! [ "$bbare" ] && actionmsg "\n$msg"||
|
Thanks Roman





Messages sorted by: Reverse Date, Date, Thread, Author