Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: list last modified files
- X-seq: zsh-users 20438
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: list last modified files
- Date: Thu, 20 Aug 2015 07:20:08 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>, rooom <rooom@xxxxxxxxxxx>
- 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=eYNhogS+vTKpYKhI/znh87X0n24GvphUMcTu8mbl5rI=; b=iKhEvsjTZyXRg2SXE6KZTI7pd3Awvjm3M2Sjbftwv+0e9mU1h/CrrK6VD/kOqeDtjU V0FripbrPa05qWIrrfnF/lWD9Ivl4LXQdRvAvD6G/70l7vPYp7TSnDbpuTyMHueMx0E6 f4suMJvmglBTyvsivSRKqrcOJyc2tMCs1fwbPxPJvZN56MuVVCYioyE47vU99P1eYui/ OkZ3/52Ybjqm8gP/2YEW2bU2dtNwDpmp6QlcFe1UavAcP4969uh6RzJnxrOnBf/KY768 vKmAvaRmEgZODuLTBxNOPt5/sGPW+NtEl+TrnjnPku85sGn+tEY1c36ZDP3odtky8IPb YPYQ==
- In-reply-to: <150819213302.ZM28036@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: <6ac3d5e6.2de49d01.55d4fc3c.9415a@prokonto.pl> <150819213302.ZM28036@torch.brasslantern.com>
On Thu, Aug 20, 2015 at 6:33 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 19, 11:59pm, rooom wrote:
> }
> } I'm trying to write a function which lists 10 most recent files
> } from given sets (not only directories), something like trivial
> } `alias lt=ls -lat | head -n 10`, but better.
>
> You can't glob if this is an arbibrary list of files. A glob qualifier
> can only be applied to files within a single directory (unless you can
> use a recursive glob like **/*) because you can't mix directory
> traversal with grouping, that is, (dir1/*|dir3/*) is an error. So you
> have to do one of --
You can do things like this though
% mkdir ab ac bc dc; () { touch $^@/{foo,bar} } ??
% echo ((ab|b?)/)#foo(e:'(( RANDOM < 16000 ))':)
ab/foo
% echo ((ab|b?)/)#foo(e:'(( RANDOM < 16000 ))':)
bc/foo
You just can't have a / inside a (foo|bar) group, which you do
potentially need sometimes. The pattern I used would also match
ab/bd/ab/bn/foo recursively.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author