Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Multi-element zstat
- X-seq: zsh-users 27135
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Phil Pennock" <zsh-workers+phil.pennock@xxxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: Multi-element zstat
- Date: Sun, 26 Sep 2021 06:54:19 +0000
- Archived-at: <https://zsh.org/users/27135>
- In-reply-to: <YU0CDH91a657L500@hill.local>
- List-id: <zsh-users.zsh.org>
- References: <20210922005142.GA4135@tarpaulin.shahaf.local2> <YU0CDH91a657L500@hill.local>
Phil Pennock wrote on Thu, 23 Sep 2021 22:39 +00:00:
> On 2021-09-22 at 00:51 +0000, Daniel Shahaf wrote:
>> How about extending the syntax to permit specifying multiple elements,
>> in which case only those will be shown?
>
>> Looping over the one-element syntax isn't convenient when multiple file
>> targets are passed. Ditto grepping the output.
>>
>> Just looking for consensus on the direction at this point; not planning
>> to implement this immediately.
>
> No objection, but since you only list two of the approaches, have you
> considered whether or not using the -H option will suit your needs?
>
> for F in *(D.); do
> zstat -nH st -- "$F"
> print "$st[mode] $st[uid] $st[gid] $st[name]"
> done
I haven't. Thanks. It certainly beats both of the workarounds
I came up with. Adding the syntactic sugar might still have value; I'll
see what I think the next time I run into this in my day-to-day uses.
Thanks again.
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author