From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14684 invoked from network); 7 Oct 1998 15:59:48 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 7 Oct 1998 15:59:48 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id LAA16286; Wed, 7 Oct 1998 11:38:03 -0400 (EDT) Resent-Date: Wed, 7 Oct 1998 11:37:57 -0400 (EDT) To: "Bart Schaefer" Cc: zsh-users@math.gatech.edu Subject: Re: Null tilde expansions? References: <981006205428.ZM10148@candle.brasslantern.com> <981007082641.ZM12497@candle.brasslantern.com> From: Greg Badros Date: 07 Oct 1998 08:41:25 -0700 In-Reply-To: "Bart Schaefer"'s message of "Wed, 7 Oct 1998 08:26:41 -0700" Message-ID: X-Mailer: Gnus v5.4.65/XEmacs 20.4 - "Emerald" Resent-Message-ID: <"2T0wZ1.0.sz3.Khu6s"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1841 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" writes: > On Oct 7, 8:00am, Greg Badros wrote: > } Subject: Re: Null tilde expansions? > } > } "Bart Schaefer" writes: > } > } > On Oct 6, 11:16am, Greg Badros wrote: > } > } Subject: Null tilde expansions? > } > } > } > } Is there any way to make ~notauser not cause an error (similar to the > } > } null globbing option)? > } > > } > unsetopt badpattern > } > } This doesn't work for me with Zsh 3.1.4 (few if any patches) or Zsh 3.0.5: > > In the words of Geoff Wing: I hate it when I stuff up a post. > > unsetopt badpattern nomatch Thanks. There were also some problems with the removing of ~notauser words that you suggested: > dirs=(${(M)dirs:#~) Besides the obvious typo of a closing paren for a closing brace, there are three problems: 1) I want the (R)est, not the match, right? 2) The ~ needs to be escaped, otherwise it'll get expanded. So what actually works for me in Zsh-3.1.4 and Zsh-3.0.x is: 3) The pattern after the # needs to match the whole word, so it needs a trailing *. echo ${(R)dirs:#\~*} # words that do not start with ~ #or echo ${(M)dirs:#/*} # words that start with / Thanks again for your pointers and suggestions. (And thanks to Peter Stephenson as well!) Greg