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

Re: Multi-element zstat



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