zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: LitHack <lithack0@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Random file creation in zsh shell.
Date: Sat, 17 Jun 2023 08:36:09 +0200	[thread overview]
Message-ID: <CAN=4vMogHHEb_P7GwkanFyH8L2Q4jwijz9s2Zz8ZEzaMOULhwQ@mail.gmail.com> (raw)
In-Reply-To: <CADc_fS0itRp3LKH9V9rZHroCZrocu=1CgjJW1HxrNTUkgZjJHg@mail.gmail.com>

On Sat, Jun 17, 2023 at 4:04 AM LitHack <lithack0@gmail.com> wrote:
>
> There is a way to create a random file in zsh shell by which we could hide any of our data in it.
>
> Command: <>=()

I found this surprising.

    % =true < =()
    % ls /tmp/zsh*
    /tmp/zshMw5YZq

Is it expected for `=true < =()` to leave a temporary file behind?

With the builtin `true` the behavior matches my expectation:

    % true < =()
    % ls /tmp/zsh*
    zsh: no matches found: /tmp/zsh*

Another example that leaves a temporary file behind:

    % ( exec true ) < =()

All of these work as expected, meaning that they don't leave a
temporary file behind:

    % () { =true } < =()
    % ( =true ) < =()
    % ( true ) < =()

Roman.


  parent reply	other threads:[~2023-06-17  6:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17  2:03 LitHack
2023-06-17  4:55 ` Fwd: " LitHack
2023-06-17  6:36 ` Roman Perepelitsa [this message]
2023-06-19  0:21   ` Bart Schaefer
2023-06-19  0:24 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMogHHEb_P7GwkanFyH8L2Q4jwijz9s2Zz8ZEzaMOULhwQ@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=lithack0@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).