From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3650 invoked by alias); 20 Aug 2015 05:20:11 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20438 Received: (qmail 16937 invoked from network); 20 Aug 2015 05:20:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 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== MIME-Version: 1.0 X-Received: by 10.107.131.196 with SMTP id n65mr893306ioi.75.1440048008256; Wed, 19 Aug 2015 22:20:08 -0700 (PDT) In-Reply-To: <150819213302.ZM28036@torch.brasslantern.com> References: <6ac3d5e6.2de49d01.55d4fc3c.9415a@prokonto.pl> <150819213302.ZM28036@torch.brasslantern.com> Date: Thu, 20 Aug 2015 07:20:08 +0200 Message-ID: Subject: Re: list last modified files From: Mikael Magnusson To: Bart Schaefer Cc: Zsh Users , rooom Content-Type: text/plain; charset=UTF-8 On Thu, Aug 20, 2015 at 6:33 AM, Bart Schaefer 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