Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Random file creation in zsh shell.
- X-seq: zsh-workers 51875
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: LitHack <lithack0@xxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: Random file creation in zsh shell.
- Date: Sun, 18 Jun 2023 17:21:05 -0700
- Archived-at: <https://zsh.org/workers/51875>
- In-reply-to: <CAN=4vMogHHEb_P7GwkanFyH8L2Q4jwijz9s2Zz8ZEzaMOULhwQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CADc_fS0itRp3LKH9V9rZHroCZrocu=1CgjJW1HxrNTUkgZjJHg@mail.gmail.com> <CAN=4vMogHHEb_P7GwkanFyH8L2Q4jwijz9s2Zz8ZEzaMOULhwQ@mail.gmail.com>
On Fri, Jun 16, 2023 at 11:36 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Sat, Jun 17, 2023 at 4:04 AM LitHack <lithack0@xxxxxxxxx> wrote:
> >
> > There is a way to create a random file in zsh shell by which we could hide any of our data in it.
>
> Is it expected for `=true < =()` to leave a temporary file behind?
When an =(...) temp file is created, the parent shell assigns removal
to the child job, which is supposed to happen when the job exits. In
the case of a shell function or builtin, this works as expected. In
the case of an external command or a subshell that performs a "tail
call optimization" like your "( exec true )" example, the thread
that's meant to remove the temp file is replaced by a new process and
the exit-handler that would remove the file is lost.
I've spent quite a while on and off in the past prodding at the code
in exec.c to try to convince it that when there is a temp file present
it should skip the execve() and instead fork()/wait() to be able to
remove the file at the end, but have never got it to work without
breaking something else.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author