From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10794 invoked by alias); 3 Jan 2014 01:55:24 -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: 18268 Received: (qmail 10117 invoked from network); 3 Jan 2014 01:55:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=f4xQfp7fd79f3tGaPdFrzPu7JOf0uEGUBcDUgqo2hO0=; b=ZzaJM3NsChy9Gt0M1ZxclNqnwBTYk2TOE6fGcJnlOHHGAVc+wBHpE+x6xaq0F5AHre +O6EDJ5YDeFZGI04qSR+gnVxggw0GFbYgC227kUSylc4U7EDUF97VeHhLdCLfl03WKmQ pZlinenSsD2CSQIEw3mJZIUD+Y/b6pPbr/t/o2V+dHYIPbV0X5GLryg7gQ3itRGyRZCz EQ5stYCYwWXHZwm+DZ5BFFsJ19dWN/mY2tP+ulwLK6/60YAiaUMks8Zs0qrRiZ1xyncy XTqDsNCaqZukLNkWOyHBkB+6Y24PCM5lupwrHHoTnSrbFKO9tdahlaaAQRrrx+NisH1e Rprg== MIME-Version: 1.0 X-Received: by 10.49.27.8 with SMTP id p8mr146932392qeg.64.1388714106331; Thu, 02 Jan 2014 17:55:06 -0800 (PST) In-Reply-To: <140102133636.ZM10014@torch.brasslantern.com> References: <140101134459.ZM8931@torch.brasslantern.com> <20140102210147.0eca0601@pws-pc.ntlworld.com> <140102133636.ZM10014@torch.brasslantern.com> Date: Fri, 3 Jan 2014 02:55:06 +0100 Message-ID: Subject: Re: difference between ~ & ^ negation From: Mikael Magnusson To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 2 January 2014 22:36, Bart Schaefer wrote: > On Jan 2, 9:01pm, Peter Stephenson wrote: > } Subject: Re: difference between ~ & ^ negation > } > } On Wed, 01 Jan 2014 13:44:59 -0800 > } Bart Schaefer wrote: > } > Important note: ^ is special only in cases where / is special (globs). > } > } That's not true... > } > } setopt extendedglob > } [[ foo = ^foo ]] || print foo actually is foo > } [[ bar = ^foo ]] && print but bar is not foo > } > } "^" is still special here; the difference is that if a "/" appeared > } after it *that* wouldn't be special in this context > > Hmm. So what does that mean about a "^" appearing after a "^" ? That > is, since / is not special, the expression ^foo/^bar means something > completely different in pattern context and file generation context? > > That second caret is the usage I was referring to when I said "only in > cases where / is special". (Whether or not there is a leading caret.) > I think of ^foo as a * that won't match "foo", so you can have foo/bar^baz and it would match bar* but not barbaz, and if you think of it like that it's not really that confusing. ^foo/^bar is then just */* that won't match */bar or foo/*. -- Mikael Magnusson