Zsh Mailing List Archive
Messages sorted by:
Re: Suppressing "no matches found" Glob Message?
- X-seq: zsh-users 7609
- From: DervishD <raul@xxxxxxxxxxxx>
- To: Aaron Davies <agdavi01@xxxxxxxxxxxxxx>
- Subject: Re: Suppressing "no matches found" Glob Message?
- Date: Mon, 28 Jun 2004 10:53:00 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <6D3CE77E-C88C-11D8-A1EE-000A95EDC31A@xxxxxxxxxxxxxx>
- Mail-followup-to: Aaron Davies <agdavi01@xxxxxxxxxxxxxx>, 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>
Hi Aaron :)
* Aaron Davies <agdavi01@xxxxxxxxxxxxxx> dixit:
> >Yes, change your pattern to, for example 'ls **/*(.N)'. The 'N'
> >means 'set option NULL_GLOB' for this pattern. This removes the
> NULL_GLOB seems to remove the pattern entirely, so it no longer finds
> plain files only.
NULL_GLOB makes zsh deleting the pattern if no match is found,
but happens that 'ls', without options, prints all files and dirs in
the current directory.
> I think what I want may be NOMATCH instead, but I
> can't figure out a code to set that. Is there one?
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 '**/*(.)'
In certain sense, what you want is impossible. If you issue the
'ls' command with parameters, it will list those parameters (if they
exist), but if you don't give it params, it will list all files and
dirs. You cannot have a way of 'ls' shutting its mouth up if the
pattern doesn't match anything.
If you want that behaviour, use 'print' instead of 'ls'.
Something like 'print -l **/*(.N)' will do. If you want all details
for the files you will need a loop or something like that.
Hope that helps :)
Raúl Núñez de Arenas Coronado
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
Messages sorted by: