zsh-users
 help / color / mirror / code / Atom feed
From: Thorsten Kampe <thorsten@thorstenkampe.de>
To: zsh-users@sunsite.dk
Subject: Re: Suppressing failed glob patterns
Date: Thu, 4 Dec 2008 22:32:03 +0100	[thread overview]
Message-ID: <gh9i8d$ano$3@ger.gmane.org> (raw)
In-Reply-To: <0F9002B9-8319-47A6-9517-4AD88B3A83E5@gmail.com>

* Michael Hernandez (Thu, 4 Dec 2008 16:26:37 -0500)> 
> On Dec 4, 2008, at 3:55 PM, Thorsten Kampe wrote:
> > I like the default in zsh for failed glob patterns (which errors  
> > when no
> > file matches the pattern).
> >
> > For example:
> > % rm file1.* file2.*
> > zsh: no matches found: file1.*
> >
> > zsh never executes rm (which is fine). Additionially I would like to  
> > get
> > rid of the error message in a script. Unfortunately redirecting stderr
> > does not work (because rm is never executed). Is there a way to keep  
> > the
> > default and to suppress the error?!
> >
> > Thorsten
> >
> 
> 
> I replied but didn't read carefully enough the first time, I see you  
> want to keep your default value, so maybe you don't want to setopt  
> no_nomatch. If this is the case you could start the function that  
> calls the rm command with:
> 
> setopt local_options no_nomatch

Yes, that's what I've been using until now. The problem is that I don't 
know what a program that expects an argument will do if it receives no 
argument. It might simply print help or await input from stdin. So the 
default is for me exactly the best. Only the zsh's error is a kind of a 
cosmetic problem in script (while interactively it's of course what I 
want).

Thorsten


  reply	other threads:[~2008-12-04 21:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 20:55 Thorsten Kampe
2008-12-04 21:04 ` Frank Terbeck
2008-12-04 21:17   ` Michael Hernandez
2008-12-04 21:24   ` Thorsten Kampe
2008-12-04 21:27     ` Bart Schaefer
2008-12-04 21:33       ` Thorsten Kampe
2008-12-04 21:29     ` Frank Terbeck
2008-12-04 21:30     ` Benjamin R. Haskell
2008-12-04 21:39       ` Stephane Chazelas
2008-12-04 21:13 ` N.J. Mann
2008-12-04 21:21   ` Michael Hernandez
2008-12-04 21:21   ` Frank Terbeck
2008-12-04 21:25   ` Thorsten Kampe
2008-12-08 23:19     ` Benjamin R. Haskell
2008-12-04 21:26 ` Michael Hernandez
2008-12-04 21:32   ` Thorsten Kampe [this message]
2008-12-04 21:44     ` Michael Hernandez
2008-12-04 21:36 ` Stephane Chazelas
2008-12-04 21:40   ` Thorsten Kampe

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='gh9i8d$ano$3@ger.gmane.org' \
    --to=thorsten@thorstenkampe.de \
    --cc=zsh-users@sunsite.dk \
    /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).