From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1500 invoked by alias); 2 Jan 2014 21:08:53 -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: 18265 Received: (qmail 18799 invoked from network); 2 Jan 2014 21:08:47 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=fTzuhmxZuno8vXS9mQhS5n8W/cTOBoDr1T9U51ggG7Y=; b=YYjKx8DcreAmCy2dgPBOOcMNzpAsk+EzNNB3JfPWnxDIScyTerrXrxkiwdaNJWzvdx yXKKdMOjzihXs3kCcKglc6IEeZZdSF6s9QbtUYFnIqlqkdiNpZaJbj/LpQ/eOUMAxIxT rUel8Qf3di09af2jKK3GT/Uez4be/mk7xz6t7qpLS1yUPsCAjXvXqmjEzM+Lx8dkgB4Z KyDAyhYNpFe42zd59jaiOGFR3WeWgKtHqcr8t99HLGy8S0CJYcfHRRNBEPAD5F8nSP69 RQzN13QAijByI2+zZ3Ctvz1xRXi51KSAkikgrqjIS+DSja/vArhFJ33Idw1puuGXsZb1 6ovw== X-Gm-Message-State: ALoCoQmKAWEWkzBfICFSRZlV9V5jsfEz8n1C1JqZh+9zn88UbwZ5w2tf59PyWQD5YtaxgRe3I66R X-Received: by 10.180.205.162 with SMTP id lh2mr55489442wic.57.1388696510255; Thu, 02 Jan 2014 13:01:50 -0800 (PST) X-ProxyUser-IP: 86.6.157.246 Date: Thu, 2 Jan 2014 21:01:47 +0000 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: difference between ~ & ^ negation Message-ID: <20140102210147.0eca0601@pws-pc.ntlworld.com> In-Reply-To: <140101134459.ZM8931@torch.brasslantern.com> References: <140101134459.ZM8931@torch.brasslantern.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, i.e. the effect of the "^" would extend to the end of the context (next closing parenthesis or end of string). However, that's the normal behaviour of operators --- only ~ extends over "/"s in file context. As the FAQ says, Note that `~' is the only globbing operator to have a lower precedence than `/'. For example, `**/foo~*bar*' matches any file in a subdirectory called `foo', except where `bar' occurred somewhere in the path (e.g. `users/barstaff/foo' will be excluded by the `~' operator). As the `**' operator cannot be grouped (inside parentheses it is treated as `*'), this is one way to exclude some subdirectories from matching a `**'. The form (^foo/)# also works. pws