Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppressing "no matches found" Glob Message?
- X-seq: zsh-users 7612
- From: Lloyd Zusman <ljz@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Suppressing "no matches found" Glob Message?
- Date: Tue, 29 Jun 2004 05:56:12 -0400
- Cancel-lock: sha1:QTiX6ogeyfPBmhGP9PHemNONGBY=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- 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> <20040629085235.GC3953@DervishD>
- Sender: news <news@xxxxxxxxxxxxx>
¡Hola Raúl!
DervishD <raul@xxxxxxxxxxxx> writes:
> [ ... ]
>
> * Aaron Davies <agdavi01@xxxxxxxxxxxxxx> dixit:
>> 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 print nothing _except_ a possible error message!
How about this?
function special_ls() {
emulate -L zsh
setopt NOMATCH
{ ls **/*(.) } 2>/dev/null
return 0
}
--
Lloyd Zusman
ljz@xxxxxxxxxx
God bless you.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author