Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppressing "no matches found" Glob Message?
- X-seq: zsh-users 7611
- From: DervishD <raul@xxxxxxxxxxxx>
- To: Aaron Davies <agdavi01@xxxxxxxxxxxxxx>, t@xxxxxxxxxxxxxxxxxxxxxx
- Subject: Re: Suppressing "no matches found" Glob Message?
- Date: Tue, 29 Jun 2004 10:52:35 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <04955BBD-C956-11D8-ADCC-000A95EDC31A@xxxxxxxxxxxxxx>
- Mail-followup-to: Aaron Davies <agdavi01@xxxxxxxxxxxxxx>, t, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Pleyades
- References: <2A3E94EA-C7E3-11D8-9C37-000502631FBD@xxxxxxxxxxxx> <20040627104222.GA237@DervishD> <6D3CE77E-C88C-11D8-A1EE-000A95EDC31A@xxxxxxxxxxxxxx> <20040628085300.GA1443@DervishD> <04955BBD-C956-11D8-ADCC-000A95EDC31A@xxxxxxxxxxxxxx>
Hi Aaron :)
* Aaron Davies <agdavi01@xxxxxxxxxxxxxx> dixit:
> >Don't know, but you don't want NOMATCH set: it *prints* an error
> >if a match is not found. If you unset it, what you are going to have
> >is the pattern as-is, so 'ls' will complain saying that '**/*(.)'
> >doesn't exist.
> That wouldn't be so bad, actually; I could redirect that error to
> /dev/null. So, does anyone know how to set that option in a pattern?
I don't know. I've took a look at the manual and I haven't found
anything about it. Anyway, if you are using such pattern you're bound
to zsh, so, why not using 'print' instead of 'ls'? Using the 'stat'
module of zsh will give you all information 'ls' gives.
Otherwise, your solution of redirecting the error is good. You
just need a shell function in order to set the NOMATCH option,
something like (I'm writing on the fly, so it's untested):
function special_ls() {
emulate -L zsh
setopt NOMATCH
ls **/*(.) >& /dev/null
return 0
}
That will do.
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author