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

Re: Getting the name of zsh-generated temp file?



"Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> writes:

> It should be pointed out that assigning the =(...) expression to a variable
> is meant to be the only way to get the temporary file to persist.  In all
> other cases (and, in older versions of zsh, even for assignments) the file
> is automatically removed as soon as the surrounding expression completes.
>
> Lloyd originally wrote:
>> One of these is left sitting around in /tmp after each termination
>
> In short, This Should Not Happen unless zsh is crashing or you are doing
> something unusual to cause the file to be left behind.

I am using 'exec' to invoke a different executable from within my zsh
script.  I think that this is preventing the temp file from being
removed.  I have control of the other executable, and so I now can pass
the name of the temp file as an argument to this executable, who now
explicitly removes it.

And I should add I deliberately want to replace my script with the other
executable, which is why I'm using 'exec'.

-- 
 Lloyd Zusman
 ljz@xxxxxxxxxx



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