Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Capturing STDOUT without subshells or file I/O
- X-seq: zsh-users 23651
- From: dana <dana@xxxxxxx>
- To: Ben Klein <robobenklein@xxxxxxxxx>
- Subject: Re: Capturing STDOUT without subshells or file I/O
- Date: Mon, 17 Sep 2018 16:19:48 -0500
- Cc: zsh-users@xxxxxxx, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, Joey Pabalinas <joeypabalinas@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6sUGfKlD9RmvycnkjGf7WTTskg4Lfwn25reveTrW5Po=; b=E1yqLPrs8q/pq0dAj49ZySYXJ9eNDCTC+zSWd13cpmJGx4k76h31S3CyIwN8XLxgPS AK3vnCoF/88nc2ZUT/I6L/e4fh6Hoscfav4JLe+JCFqJaBvF1nB8wGJI/YKkNJZaU480 0weRNZIJw0XHHihy+RmlMNxQmG5Ld0D3L5ggZF77JYFV4H0XpV3L2DSxgmUomaAI1vZr Ohv4TEjcMcO4I6wywsc7Ty/jiQgmu4RE9RL12WBrdKrd5pt/i9m4A0NEj0uAkdd2geDK kGKwGo35kwfnDbZ0XTcWe+43Mdx3SEYftxdyUm/BISWDmJYMNvZFFhwPyhrF3QfujxJg gMWA==
- In-reply-to: <cd8bc7e0-7ae1-8c94-8dea-9b529b2a8fb2@gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <04a12c6a-c926-b088-f386-8a2bdb81dad2@gmail.com> <20180903140214.76kbzgpfru6atc5u@tarpaulin.shahaf.local2> <20180903184353.yzujt7ywnlvufeye@gmail.com> <cd8bc7e0-7ae1-8c94-8dea-9b529b2a8fb2@gmail.com>
On 17 Sep 2018, at 15:13, Ben Klein <robobenklein@xxxxxxxxx> wrote:
>So I guess the question is up again, how should I capture the `printf` output
>without the `-v` option, no subshells, and no file I/O? Is there a different
>method for ZSH v5.1?
Mikael once showed me this trick:
print -zf '%.2f' 3.4
read -rz var
echo $var # 3.40
Not sure if there are any situations where it would break.
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author