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

Re: Process substitution and shell functions

"Bart Schaefer" wrote:
> On Sep 24,  6:47pm, Louis Granboulan wrote:
> } Subject: Re: Process substitution and shell functions
> }
> } My patch moves the recovering of last_file_list from execpline
> } to execshfunc.
> } I don't understand why this was in execpline...
> It can't go in execshfunc because execshfunc isn't executed when using
> a simple builtin or an external command.

Does that matter?  last_file_list was only ever set before from
execshfunc() and execcursh() via deletepipejob().  It was then set to
NULL at the beginning of every pipeline... goodness knows what effect
that was supposed to have, but I think LG is saying that the (real)
desired effect can be obtained locally in execshfunc() and

As far as I can see simple builtins/builtouts didn't need this
mechanism, the job.filelist element worked directly.  They would only
be affected when a new pipeline was started to run one, at which point
they would take over the file list from any shell function or {...}
construct and delete the appropriate files when they finished, which
seems a bit strange (and must have been the cause of the bug being

I agree with LG that there's no obvious reason why shell functions and
{...}'s shouldn't be directly responsible for their own file lists.  I
think the `if (!list_pipe) ...' tests are OK since list_pipe is either
set and restored in the same function or unconditionally set to zero,
which would presumably be harmless here.

Anyway, the patch seems to work O.K. --- unless, of course, you know
better.  It's quite likely I'm missing something, or a lot.  The only
worry I have is that temporary files might get left over on an exec.

Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.

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