From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6527 invoked by alias); 7 Dec 2014 19:04:42 -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: 19504 Received: (qmail 21224 invoked from network); 7 Dec 2014 19:04:40 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.25.230] X-Spam: 0 X-Authority: v=2.1 cv=dY0O3Bne c=1 sm=1 tr=0 a=c0CwWhpM9oUd/BnC3z6Gzg==:117 a=c0CwWhpM9oUd/BnC3z6Gzg==:17 a=NLZqzBF-AAAA:8 a=A92cGCtB03wA:10 a=RJ6xJKJMkgLQ6eD9oxcA:9 Message-Id: <201412071901.sB7J1Ymo005977@pws-pc.ntlworld.com> X-Authentication-Warning: pws-pc.ntlworld.com: pws owned process doing -bs From: Peter Stephenson To: "zsh-users@zsh.org" Subject: Re: Exclusion on filename expansion In-Reply-To: Message from Vin Shelton of "Sun, 07 Dec 2014 13:50:23 EST." Date: Sun, 07 Dec 2014 19:01:34 +0000 Vin Shelton wrote: > Using a variable, I cannot get ~ exclusion to work: > > ls *~abc~def > ==> ghi jkl > pat="abc~def" > ls -d *~$pat > ==> abc def ghi jkl > > I think that expansion of $pat is happening after globbing, so in this case > "*" expands to > > abc def ghi jkl > > without the application of the tilde exclusion. > > Is there something I can do about this? "setopt glob_subst", or probably better use $~pat which turns on glob_subst for that expansion. The "~" may appear to be an obvious mnemonic, but actually it was originally introduced to do the more standard form of ~-expansion. It now turns on that and glob expansion. pws