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

Re: array matching: inconsistent behaviour ?



On Wed, Jan 9, 2013 at 9:26 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>wrote:

> On Jan 9,  4:03pm, rahul wrote:
> }
> } I've been using the "print -rC" to print in columns -- saves me from
> quite
> } a bit of programming. However, often the data has spaces in it, or tabs.
> Of
> } course, print will wrap/break on those.
>
> "print" doesn't do any wrapping/wordsplitting internally, so if you are
> getting columns broken up on whitespace in the data, it's because of
> command-line parsing.  Change the way you quote the arguments to print.
>

Okay, great- I just tried out a one-liner and it works:

    print -rC2 -- "${(@f)$(brew list --versions)}"

    print -rC2 -- "${(@f)$(print -rl -- *(.) | nl)}"

-- 
thx,  rahul


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