Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: virtual files?
- X-seq: zsh-users 21467
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: virtual files?
- Date: Wed, 20 Apr 2016 23:58:00 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=wcuf6j85ZPffW9lzo+8dfHw9oTYSTNmKjQhk0lI9u9k=; b=c0VZ57FWe3nce6DDvKNJetm5T49sCL5UKmQWfUdNNOS8HtY+BFB51UPlbzLw9PHjOd MVLh6FCvAox1/35KRPDYv/6X4wJRIt9UAvPvyi34DS17SoyTDOB3+HgylDp3aFLUy4eF PH7P2Nd6Kp/0DLo883VuAiiJxxpKNLEtMIAwDTV2KDlCPCvOfM74H4oBt4RTz9R7PpSb aKBe1bQ6iNQ1YnYNLC+28drRD0wv5FoMXB4Q8GhzvLKa6VnoqG4iKkqyTdYBBtidH4qX 5fA6BhRPyKl/lGzR+2SIjslblA+zRpL0KYsMmSWyjRSC3klQYb5L0JofYV12JWpA/Dg3 wDCA==
- In-reply-to: <87zisneh10.fsf@student.uu.se>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <8760vdrt5y.fsf@student.uu.se> <CAB2RFrTTibd-8FLs5GoGbMiTS2Gk8L8CVq1gC5im_8LmF3F6Zw@mail.gmail.com> <87zisneh10.fsf@student.uu.se>
On Apr 21, 4:12am, Emanuel Berg wrote:
}
} What is the colon in =(:) - an "anonymous function
} qualifier"?
The syntax =(command) runs command and captures its output in a temp
file, then substitutes the name of the temp file; the file itself is
removed as soon as the current command finishes. So
echo =(echo foo)
will print something like /tmp/zshhKNk2F and
cat =(echo foo)
will print foo.
Thus
() { cat $1 } =(echo foo)
also prints foo. The ":" command is just a quick built-in no-op that
produces no output, so that the temporary file created by =(:) will
be empty.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author