zsh-users
 help / color / mirror / code / Atom feed
From: DervishD <raul@pleyades.net>
To: Aaron Davies <agdavi01@louisville.edu>
Cc: zsh-users@sunsite.dk
Subject: Re: Suppressing "no matches found" Glob Message?
Date: Mon, 28 Jun 2004 10:53:00 +0200	[thread overview]
Message-ID: <20040628085300.GA1443@DervishD> (raw)
In-Reply-To: <6D3CE77E-C88C-11D8-A1EE-000A95EDC31A@louisville.edu>

    Hi Aaron :)

 * Aaron Davies <agdavi01@louisville.edu> 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.

    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/


  reply	other threads:[~2004-06-28 11:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-27  2:39 Aaron Davies
2004-06-27 10:42 ` DervishD
2004-06-27 22:50   ` Aaron Davies
2004-06-28  8:53     ` DervishD [this message]
2004-06-28 22:53       ` Aaron Davies
2004-06-29  8:52         ` DervishD
2004-06-29  9:56           ` Lloyd Zusman
2004-06-29 10:41             ` DervishD
2004-06-29 16:12       ` Bart Schaefer
2004-06-29 16:34         ` DervishD
2004-06-29 23:04         ` Aaron Davies
2004-06-30 10:10           ` Bart Schaefer
2004-07-01  4:28             ` Aaron Davies
2004-06-27 22:52   ` Aaron Davies

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040628085300.GA1443@DervishD \
    --to=raul@pleyades.net \
    --cc=agdavi01@louisville.edu \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).