From: Greg Badros <gjb@cs.washington.edu>
To: "Bart Schaefer" <schaefer@brasslantern.com>
Cc: zsh-users@math.gatech.edu
Subject: Re: Null tilde expansions?
Date: 07 Oct 1998 08:41:25 -0700 [thread overview]
Message-ID: <qrrvhlwv0pm.fsf@fielder.cs.washington.edu> (raw)
In-Reply-To: "Bart Schaefer"'s message of "Wed, 7 Oct 1998 08:26:41 -0700"
"Bart Schaefer" <schaefer@brasslantern.com> writes:
> On Oct 7, 8:00am, Greg Badros wrote:
> } Subject: Re: Null tilde expansions?
> }
> } "Bart Schaefer" <schaefer@brasslantern.com> 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
next prev parent reply other threads:[~1998-10-07 15:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-06 18:16 Greg Badros
1998-10-07 1:13 ` Sweth Chandramouli
1998-10-07 3:54 ` Bart Schaefer
1998-10-07 15:00 ` Greg Badros
1998-10-07 15:11 ` Peter Stephenson
1998-10-07 15:26 ` Bart Schaefer
1998-10-07 15:41 ` Greg Badros [this message]
1998-10-07 16:47 ` Bart Schaefer
1998-10-07 17:50 ` Greg Badros
1998-10-07 18:36 ` Bart Schaefer
1998-10-08 7:29 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=qrrvhlwv0pm.fsf@fielder.cs.washington.edu \
--to=gjb@cs.washington.edu \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).