zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>, rooom <rooom@prokonto.pl>
Subject: Re: list last modified files
Date: Thu, 20 Aug 2015 07:20:08 +0200	[thread overview]
Message-ID: <CAHYJk3Sa5Fc4d37sFq0HcMFXnH8eXqvoT7GcKPcb3NJs+1kFnQ@mail.gmail.com> (raw)
In-Reply-To: <150819213302.ZM28036@torch.brasslantern.com>

On Thu, Aug 20, 2015 at 6:33 AM, Bart Schaefer
<schaefer@brasslantern.com> 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


  reply	other threads:[~2015-08-20  5:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 21:59 rooom
2015-08-19 23:16 ` Vin Shelton
2015-08-20  4:33 ` Bart Schaefer
2015-08-20  5:20   ` Mikael Magnusson [this message]
2015-08-20 13:08   ` rooom
2015-08-20 13:29     ` Peter Stephenson
2015-08-20 15:34       ` Bart Schaefer
2015-08-20 15:55         ` Peter Stephenson
2015-08-20 17:13           ` Bart Schaefer
     [not found]         ` <20150820165552.2b5ec817__22391.7863135741$1440086232$gmane$org@pwslap01u.europe.root.pri>
2015-08-20 16:42           ` Stephane Chazelas
2015-08-20 17:09             ` Bart Schaefer
2015-08-23 20:35     ` ZLE: missing edit-buffer widget rooom
2015-08-23 21:45       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3Sa5Fc4d37sFq0HcMFXnH8eXqvoT7GcKPcb3NJs+1kFnQ@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=rooom@prokonto.pl \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).