Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Null tilde expansions?
- X-seq: zsh-users 1841
- From: Greg Badros <gjb@xxxxxxxxxxxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Null tilde expansions?
- Date: 07 Oct 1998 08:41:25 -0700
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: "Bart Schaefer"'s message of "Wed, 7 Oct 1998 08:26:41 -0700"
- References: <qrrr9wly2rn.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx> <981006205428.ZM10148@xxxxxxxxxxxxxxxxxxxxxxx> <qrr67dwwh6p.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx> <981007082641.ZM12497@xxxxxxxxxxxxxxxxxxxxxxx>
"Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> writes:
> On Oct 7, 8:00am, Greg Badros wrote:
> } Subject: Re: Null tilde expansions?
> }
> } "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author