Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ls most recent files in a hierarchy
- X-seq: zsh-users 10043
- From: Christian Schneider <strcat@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: ls most recent files in a hierarchy
- Date: Sat, 18 Mar 2006 01:38:59 +0100
- In-reply-to: <060315195731.ZM16051@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Born to frag.
- References: <Xns9788654E75Bzzappergmailcom@xxxxxxxxxxx> <20060316014618.GC16669@xxxxxxxxxxxxxxxxxxx> <060315195731.ZM16051@xxxxxxxxxxxxxxxxxxxxxx>
Hi,
* Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> typed:
> On Mar 16, 2:46am, Christian Schneider wrote:
> } Subject: Re: ls most recent files in a hierarchy
> }
> } > 2) list x most recent files in each directory of a hierarchy
> }
> } ls **/*(D.om[1,5]) # 5 recent files
>
> As Lloyd has pointed out, that's actually the answer to #3:
Thats correct. I get it wrong. Sorry about that.
> } > 3) list x most recent files in a hierarchy
>
> The answer to #2 is less obvious:
>
> ls *(ND.om[1,5]) **/*(D/e:'reply=( $REPLY/*(ND.om[1,5]) )':)
>
> That also requires a fairly recent version of zsh; none of the 4.2.x
> series has the fix, they'll either crash or go into an infinite loop
> when presented with the glob-within-a-glob.
>
> For the 4.2.x line, you need something like:
>
> dirs=( '' **/*(DM/) ) eval 'ls ${^dirs}*(ND.om[1,5])'
>
> which is perhaps clearer anyway and works in 4.3.x too.
Thanks! I can can dispose it on a old^Wstable Debian i also managed.
--
Could I have a drug overdose?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author