From: Stephane Chazelas <stephane@chazelas.org>
To: Zach Riggle <zachriggle@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Where is this =(:) construct documented?
Date: Fri, 11 Jun 2021 20:53:22 +0100 [thread overview]
Message-ID: <20210611195322.4tnhhppbjpddi2tv@chazelas.org> (raw)
In-Reply-To: <CAMP9c5n+K-UYHaEC7fOo0AtL5RFhmWs31aDeiwSGn_BrFan_4A@mail.gmail.com>
2021-06-11 14:17:08 -0500, Zach Riggle:
> It's insane, cool, and I can't find this documented anywhere. It
> creates a temporary file that is automatically deleted... but only
> after the line / expression terminates.
[...]
> What's more insane is that the temporary file will be auto-populated
> with the output of the =() construct. Where is THAT documented?
[...]
See
info zsh "Process Substitution"
Or:
https://zsh.sourceforge.io/Doc/Release/Expansion.html#Process-Substitution
That's the third form of process substitution.
ksh introduced the first two <(...) and >(...) in the 80s. zsh
added that third form in the 90s.
While A <(B) and A >(B) are IPC mechanisms in that A and B are
started concurrently and connected via a pipe (<(B) and >(B)
expand respectively to the path of the reading of a pipe and
writing end of a pipe, in A =(B), B is started first, its output
collected into a temp file, and the path of that temp file
passed to A when B has finished (and later removed when A
finishes).
--
Stephane
next prev parent reply other threads:[~2021-06-11 19:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 19:17 Zach Riggle
2021-06-11 19:18 ` Zach Riggle
2021-06-11 19:53 ` Stephane Chazelas [this message]
2021-06-11 19:58 ` Roman Perepelitsa
2021-06-11 20:04 ` Stephane Chazelas
2021-06-11 20:39 ` Zach Riggle
2021-06-14 12:44 ` Vincent Lefevre
2021-06-14 14:32 ` Stephane Chazelas
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=20210611195322.4tnhhppbjpddi2tv@chazelas.org \
--to=stephane@chazelas.org \
--cc=zachriggle@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).