zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Cc: beelzebubbie.logs@gmail.com
Subject: Re: `=' expansion causes script/subshell to exit, bug?
Date: Thu, 27 Sep 2018 13:33:53 -0700	[thread overview]
Message-ID: <CAH+w=7Zi5PC5eVQA02RytjXCTwF+oWS-awq7u0x0kawA04aojg@mail.gmail.com> (raw)
In-Reply-To: <647E0B88-B2E9-4337-B3CA-439093B02C17@dana.is>

On Thu, Sep 27, 2018 at 12:41 PM dana <dana@dana.is> wrote:
>
>   If a pattern for filename generation has no matches, print an error, instead
>   of leaving it unchanged in the argument list. This also applies to file
>   expansion of an initial ‘~’ or ‘=’.
>
> The documentation could probably be more explicit — it doesn't just print an
> error, it also aborts the current command (and apparently the following ones; i
> didn't even realise that).

This is more fully described in the "Errors" section of the manual (see
http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Errors
"Certain errors are treated as fatal by the shell: in an interactive
shell, they cause control to return to the command line, and in a
non-interactive shell they cause the shell to be aborted.")

In particular it lists:
* File generation errors where not caught by the option BAD_PATTERN
* File generation failures where not caused by NO_MATCH or similar options

I'm a little puzzled by the "not" in that second one because this
clearly does cause an abort on a non-match.  Maybe it means "where not
caught by"?  Of course the first one is also sort of backward, it
should probably say "NO_BAD_PATTERN" or make reference to "unsetopt
BAD_PATTERN".

> You can disable it by setting either no_nomatch or null_glob

null_glob has no effect on this for me.  I think you must have
accidentally had both nonomatch and nullglob set.

  reply	other threads:[~2018-09-27 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 19:20 Vasiliy Ivanov
2018-09-27 19:41 ` dana
2018-09-27 20:33   ` Bart Schaefer [this message]
2018-09-27 20:37     ` dana
2018-09-27 22:38 ` Mikael Magnusson

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='CAH+w=7Zi5PC5eVQA02RytjXCTwF+oWS-awq7u0x0kawA04aojg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=beelzebubbie.logs@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).