zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Joe Rice <jsrice@protonmail.com>, zsh-workers@zsh.org
Subject: Re: [PATCH] respect nullglob given multios
Date: Fri, 11 Oct 2019 09:33:26 +0100 (BST)	[thread overview]
Message-ID: <1570087298.4348177.1570782806538@mail2.virginmedia.com> (raw)
In-Reply-To: <lSzcSt2-L6melPjC4U9aH-gwyQ9YwbsQKX-WtKyiWOtyYp5bK0ijIluIyrFR3_7SlEEtbZUFT65D77k4OJjDUCdJfqipkmM9xcNyup3xtpw=@protonmail.com>

> On 11 October 2019 at 07:46 Joe Rice <jsrice@protonmail.com> wrote:
> > On Thu, 2019-10-10 at 16:40 +0000, Peter Stephenson wrote:
> > > On Thu, 2019-10-10 at 01:18 +0000, Joe Rice wrote:
> > >
> > > > This patch makes multios behave less surprisingly with nullglob.
> > > > Currently, multios throws a file not found error when a nullglob is
> > > > given. This patch inserts /dev/null into the redirection list when
> > > > the
> > > > glob returns empty with no errors.
> > > > Is this a behavior that would interest anyone else? I find myself
> > > > using the `cat /dev/null *(N.)` idiom quite a bit and I thought the
> > > > behavior made sense for the null case in multios.
> > >
> > > This does seem a logical effect, though it ought to be documented.
> >
> > I am not sure if it's that logical.
> > What about if the pipeline on left of the redirection is something
> > expensive?
> > I'd rather have the command fail than starting a long-running job whose
> > output will be lost.
> 
> For the case of expensive pipelines on the left side, running with a global nullglob
> and expecting it to never be null already seems like a risky proposition, and if they
> were using an explicit qualifier, then I think they would have sufficiently acknowledged
> that behavior.

I tend to agree with your analysis here.  Philippe's argument seems to boil down to that
nullglob should somehow behave like not having nullglob in case you don't want nullglob
behaviour?  But maybe others have views.

pws

      reply	other threads:[~2019-10-11  8:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191010011901epcas4p3219be0dd0e02bc7168787305e4e1dcf6@epcas4p3.samsung.com>
2019-10-10  1:18 ` Joe Rice
2019-10-10 16:40   ` Peter Stephenson
2019-10-11  0:25     ` Philippe Troin
2019-10-11  6:46       ` Joe Rice
2019-10-11  8:33         ` 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=1570087298.4348177.1570782806538@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=jsrice@protonmail.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).