zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: "Šimon Let" <simon.a.let@gmail.com>, zsh-workers@zsh.org
Subject: Re: Issue: Handling of globbing fails
Date: Mon, 12 Feb 2018 17:03:04 +0000	[thread overview]
Message-ID: <20180212170304.0a534bf4@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAOdNpm8pHJDTe2vbdXbVSa7wmtFTW3k7Y641_-Yif42Hqsd6WA@mail.gmail.com>

On Mon, 12 Feb 2018 17:34:11 +0100
Šimon Let <simon.a.let@gmail.com> wrote:
> Consider running following command:
> 
> `echo some_empty_directory/* && echo "NO FAIL" || echo "FAIL"`
> 
> It produces following output:
> 
> `zsh: no matches found: some_empty_dir/*`

Yes, it's an error, and is documented as such.  Please read the
documentation for 'filename generation' and in particular the second
paragraph below where you'll also see how to modify it.

Shells have this sort of thing hard coded at a low level and have done
for a long time --- they can be counter-intuitive but I'm afraid reading
up about the subject is the only fix.  We can recommend some "light"
reading on the subject, if you like...


FILENAME GENERATION
       If  a  word contains an unquoted instance of one of the characters `*',
       `(', `|', `<', `[', or `?', it is regarded as a  pattern  for  filename
       generation,  unless  the  GLOB  option  is unset.  If the EXTENDED_GLOB
       option is set, the `^' and `#' characters also denote a pattern; other‐
       wise they are not treated specially by the shell.

       The  word  is  replaced  with a list of sorted filenames that match the
       pattern.  If no matching pattern is found, the  shell  gives  an  error
       message,  unless the NULL_GLOB option is set, in which case the word is
       deleted; or unless the NOMATCH option is unset, in which case the  word
       is left unchanged.


pws


      reply	other threads:[~2018-02-12 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180212163514epcas5p34a9c8c3dd91cc702e72871cb009648ef@epcas5p3.samsung.com>
2018-02-12 16:34 ` Šimon Let
2018-02-12 17:03   ` Peter Stephenson [this message]

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=20180212170304.0a534bf4@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=simon.a.let@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).