Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Suppressing "no matches found" Glob Message?



On Jun 28, 2004, at 4:53 AM, DervishD wrote:

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
error.

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 '**/*(.)'
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?
--
Aaron Davies
agdavi01@xxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author