Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: array matching: inconsistent behaviour ?
- X-seq: zsh-users 17550
- From: rahul <rahul2012@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: array matching: inconsistent behaviour ?
- Date: Wed, 9 Jan 2013 22:23:25 +0530
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Yj4pI5zERxQTOGRaM8M2C4dvXnpHquVxGxHjK9y0Di4=; b=IdwbKayObD718I/FqGU5IrnR/PZtM0TK/jbu2zPmKffhSL+KZOQ3qKyXwql2H22QMr kR7nBwxC9XeCc0TaQ2+v7WM6swR59uQizXvFq6g/89JWjd7lD++n7yjx/yuVnZiUFH6w XIBLqGiDFLMFqlQDDdeK6Yr/hIlxBJY6PNludwo1H+OOCCgQcL6tqwBgtAkOOLUJITf+ pX9Zx6kDjr1Cw5ga1P31hcy50PE1jrwJFD5RnvZv++l9uxf63GHri7uyJ2Wp34vEewYG fnpmT0fcnVlnUmJCBysRddKlE5YUaDLy8XXmg5Mn1Cy5y2Mr+0e8g6MkjQMTfskDAHE7 OXTw==
- In-reply-to: <130109075626.ZM9484@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CACQNQ9Mn8ydkZ5+EckXJ38ywV8iCxyqcBzVCTFSTH4bs6QNLBw@mail.gmail.com> <20130109094054.021cbaa6@pwslap01u.europe.root.pri> <CACQNQ9Nk0=CTGacByEZJYsURZViLSksQ5z-2PfJVvW8LgtTP3w@mail.gmail.com> <130109075626.ZM9484@torch.brasslantern.com>
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