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

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



On May 5,  2:36pm, Zefram wrote:
} Subject: Re: Getting the name of zsh-generated temp file?
}
} Lloyd Zusman wrote:
} >Within a zsh script, is there any way that I can get the name of the
} >temporary file generated by the =(...) construct?
} 
} $ foo==(echo bar)
} $ echo $foo
} /tmp/zshp8oWrV
} $ cat $foo
} bar

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.



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