Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppressing failed glob patterns
- X-seq: zsh-users 13523
- From: Michael Hernandez <sequethin@xxxxxxxxx>
- To: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- Subject: Re: Suppressing failed glob patterns
- Date: Thu, 4 Dec 2008 16:26:37 -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=/grHtB97ilqyq/qGE+DDHQbuAGEf6iMD2wvbLfVHU2E=; b=tqgXsy8PPSC2gGgnV+3I0rNPB3ahMnKIb6hhMiKOu2n46gjaBhT3V23ILl1jfOi7mQ PPtL6tfyP6E1kj57si9+Cz38JOpGyzavX7wYVZHrH0wbW1OVKOx9y038h/dfLkzrcqBJ 4bVhNhoYBdwca8DppU1qo9BxW9zyJcbgqnE3w=
- 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=SNk0TPFIQ6CA8pBQOthBc4AoVGmhORbzlHDv2YWMXx9KuNnGcIMpJKruB/d8sNvs5W K6Bkn0uXwnuBNIB/snWbfsbjxA4Xm4i82MheSfXBaTDTaSdPO6LcJlxMUAIilgGr414W anWG9GH9mJuy7QuD/R19xCZvstt8+LRaQSAp0=
- In-reply-to: <gh9g43$rt5$1@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <gh9g43$rt5$1@xxxxxxxxxxxxx>
On Dec 4, 2008, at 3:55 PM, Thorsten Kampe wrote:
Hi,
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
which will set the option for the duration of the function call but
return to the default when it's done. This way you have the benefits
of the option being set for the function without changing your default
shell behavior.
--Mike H
Messages sorted by:
Reverse Date,
Date,
Thread,
Author