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

Re: [PATCH] respect nullglob given multios



> On 11 October 2019 at 07:46 Joe Rice <jsrice@xxxxxxxxxxxxxx> 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



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