Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Why does this extended glob pattern fail?



On Mon, 1 Aug 2011 12:20:58 +0200
Ronald Fischer <ynnor@xxxxx> wrote:
> On Wed, 27 Jul 2011 15:32 +0100, "Stephane Chazelas"
> <stephane.chazelas@xxxxxxxxx> 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 <pws@xxxxxxx>            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



Messages sorted by: Reverse Date, Date, Thread, Author