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

Re: Random file creation in zsh shell.



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.
>
> 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.




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