Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Filtering an array of file names
- X-seq: zsh-users 21992
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Filtering an array of file names
- Date: Thu, 29 Sep 2016 08:51:28 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=kqCNOGfeAadBah9lHgtInflRSAg6uywZ1hzEIG10OUI=; b=aJN6zOXtM+j7r3IB3eiRQ3oV3awc/G10Gu+eEOS4uw9yCc9DKFMoOQKYru+NLX6TVd f4Xjl8Gs/eZWWc1PQwbhLmDVvCzLuX6o/mF2DznltXp+A3Ia7A9iVoaB/+TBW65Cx1yn dLLbR9EVPqFu+pc0+9jP02RhQwdPOy2nFRxYn4oIv3gv75dfIYHCHvM2LE2voEdy6FtE 6kO3QF2EDaX8llA+njuOoSl0Bre38S3fFLZLK3/24DfhJblk54ErZ2rwPknnwu150uPc UB33MRarDdcfXh8d2ssuJ9H7ZYP4w3ac08Sj42ZdGRgED5AkopP/TJGvZPg+UBHHGzJf RapA==
- In-reply-to: <CAHYJk3QepQXjaVwGnHy2uRQGQqfdnpbwPDDifrw7fOXXU8K_Uw@mail.gmail.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: <CABZhJg9vf0OZyXbSOcX_7sA7aN=cHtDQq08sLKy_0Vs6xkUR1g@mail.gmail.com> <160929001853.ZM27784@torch.brasslantern.com> <CAHYJk3QepQXjaVwGnHy2uRQGQqfdnpbwPDDifrw7fOXXU8K_Uw@mail.gmail.com>
On Sep 29, 9:54am, Mikael Magnusson wrote:
}
} This should be
} directories=( ${^allfiles}(/N) )
} unless you have nullglob set
Thanks, and to Daniel also, for pointing out this nuance for the general
case, but in the OP's specific example $allfiles contains only names of
known existing files, so globbing is not expected to fail and (N) would
not be necessary.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author