Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppressing failed glob patterns
- X-seq: zsh-users 13519
- From: Michael Hernandez <sequethin@xxxxxxxxx>
- To: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: Suppressing failed glob patterns
- Date: Thu, 4 Dec 2008 16:17:58 -0500
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=XfYEBfZ8gpMD0s99TkDMyzwXW//y1YnnshdZVlLOEEk=; b=CvIk3T6Rtwv4jO39JJTaLz1dtzJBRL0BMu9WJiguXGurDUp4S0SUsrnFeFsRdvtbbX ckFvMyCkGqWYZwcl+HNhSfe7Ozy7Epf7bVdzxJAmqxfXaTouXFnDdohVlFEsVf5mGcdd 3/q3zwJeRl+5WqjkZDh82Os8UH785bhygEIpw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=gjA6G/z+mRnfRZFqw0o1OpVnaGW25AQCAX2Tbveo1F51ePFHyeHyYE61DMQ3J/iOjJ vBXtWf+26HuGA8V2QZGjvFPiGnra1AnyeLWfxmVE0C4rfCoDyVRHGI80Nfz0t6uE1mjB /MRf9dViw94WZjV15wVXOUYnOrL2Ifa5vdP4k=
- In-reply-to: <20081204210441.GJ2692@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <gh9g43$rt5$1@xxxxxxxxxxxxx> <20081204210441.GJ2692@xxxxxxxxxxxxxxx>
On Dec 4, 2008, at 4:04 PM, Frank Terbeck wrote:
Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>:
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?!
Check these settings: <http://zshwiki.org/home/options/expn>
And also see what the difference between
% echo non-existing-file.*
and
% echo non-existing-file.*(N)
is.
That's documented in 'man zshexpn' and a list of available modifiers
and flags is also in <http://www.bash2zsh.com/zsh_refcard/
refcard.pdf>.
You could use setopt no_nomatch and then rm would run, you'd get this:
% rm nowayjose*
rm: nowayhoe*: No such file or directory
Then you could redirect STDERR:
% rm nowayhoe* 2> /dev/null
[no error]
--Mike H
Messages sorted by:
Reverse Date,
Date,
Thread,
Author