Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Some problems with recursive globbing
- X-seq: zsh-users 20190
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Some problems with recursive globbing
- Date: Thu, 07 May 2015 18:00:45 +0100
- In-reply-to: <CABZhJg_2uhT-c1Gn+e+=ng3o4L=P8LJRZukjF3T7LqwiGL1OHQ@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
- Organization: Samsung Cambridge Solution Centre
- References: <CABZhJg-f_PDTtaJf8Fg6qVZQ2wLmAXG-tLXLub7Sq=GW9vXwDA@mail.gmail.com> <20150507165250.18184e1a@pwslap01u.europe.root.pri> <20150507165953.517b95b9@pwslap01u.europe.root.pri> <CABZhJg_2uhT-c1Gn+e+=ng3o4L=P8LJRZukjF3T7LqwiGL1OHQ@mail.gmail.com>
On Thu, 7 May 2015 18:46:58 +0200
Jesper Nygårds <jesper.nygards@xxxxxxxxx> wrote:
> I tried this:
> myfiles() {
> emulate -L zsh
> setopt LOCAL_OPTIONS EXTENDED_GLOB
>
> local dir="${1:a}/"
>
> local filepattern="${dir}**/*"
>
> print -c ${~filepattern}
> }
>
> % cd /private/tmp/test\(1\)
> % myfiles src
> myfiles:8: no matches found: /private/tmp/test(1)/src/**/*
$dir contains a straight string with unquoted parentheses. The
~filepattern then turns those parentheses into pattern characters.
I'm not sure why you want filepattern anyway, but
print -c ${dir}**/*
or
local filepattern="**/*"
print -c ${dir}${~filepattern}
ought to work. Otherwise you'll need to quote metacharacters in dir,
which is possible but should be unnecessary.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author