Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Why does this extended glob pattern fail?
- X-seq: zsh-users 16144
- From: "Ronald Fischer" <ynnor@xxxxx>
- To: zsh-users@xxxxxxx
- Subject: Why does this extended glob pattern fail?
- Date: Wed, 27 Jul 2011 15:53:50 +0200
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:subject:date; s=smtpout; bh=hE25yr/X1UPZE5FthGAZRB+NQe4=; b=mbwVaKaAqVefwefWxesKCmH58vst 5VR4MygMWlhtfjAdmDJSGRDzaMJM2uc+qPXCXWivp50NPWyk6S35l8Z1ztyodW/b 2vEFISfB8x27m1TPMj0ErIgBSWSi11orMR/ZVpgGWLOgNp0C+hXjdOGUpUQtZ03A YvHW/JlIaNcMUy0=
- 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
In my zsh script, I want to copy all files from a directory, except
files ending in .log and .png. This is my code:
....
setopt extendedglob # makes ^ work in glob pattern
cp ^$from/*.{log,png} $dest
....
However, there are cases when $from has neither .log nor .png files; but
it DOES contain other files. In this case I get the error message
no matches found: ^/home/...../*.log
I think this has to do with the timing of when interpretation of {....}
and when globbing is done. Why exactly do I get the error message, and
how do I code this correctly?
Im using zsh 4.2.
Ronald
--
Ronald Fischer <ronaldf@xxxxxx>
+ If a packet hits a pocket on a socket on a port,
+ and the bus is interrupted and the interrupt's not caught,
+ then the socket packet pocket has an error to report.
+ (cited after Peter van der Linden)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author