From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5365 invoked by alias); 1 Aug 2011 11:04:33 -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: 16177 Received: (qmail 18376 invoked from network); 1 Aug 2011 11:04:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Mon, 1 Aug 2011 12:04:11 +0100 From: Peter Stephenson To: Subject: Re: Why does this extended glob pattern fail? Message-ID: <20110801120411.7938f5f4@pwslap01u.europe.root.pri> In-Reply-To: <1312194058.12893.2158087337@webmail.messagingengine.com> References: <1312194058.12893.2158087337@webmail.messagingengine.com> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.11.26] X-Scanned-By: MailControl A-12-01-00 (www.mailcontrol.com) on 10.68.0.115 On Mon, 1 Aug 2011 12:20:58 +0200 Ronald Fischer wrote: > On Wed, 27 Jul 2011 15:32 +0100, "Stephane Chazelas" > wrote: > > or better, use globbing alternate operator rather than brace > > expansion: > > > > cp ^$from/*.(log|png) $dest > > Actually, this does not work either. Instead, I have to write > > cp $from/^*.(log|png) $dest > > The reason is that ^ doesn't apply to the *whole* word, but only up to > the first '/'. I'm delighted to find out I mentioned this feature --- that ^ applies to path segments --- in "From Bash to Z Shell", chapter 9, page 216. The stuff round there is a useful read for this kind of thing. http://www.bash2zsh.com/ -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog