From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23651-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ae1d61ca for ; Mon, 17 Sep 2018 21:20:06 +0000 (UTC) Received: (qmail 17238 invoked by alias); 17 Sep 2018 21:19:54 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23651 Received: (qmail 943 invoked by uid 1010); 17 Sep 2018 21:19:54 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f43.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.214.43):SA:0(-1.9/5.0):. Processed in 2.234842 secs); 17 Sep 2018 21:19:54 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6sUGfKlD9RmvycnkjGf7WTTskg4Lfwn25reveTrW5Po=; b=qDanLFv3ATctgWbAPLj9JUTgip/dHcX1qFlzpH951+g5GBxZQvbB4zgp0tTIVlHr5C OrxG6OhZsuBdHN/HpfknfKFdS1lVWr4nybgv+atllIM1qDQhqa8QcGyaKgR8/zInvtGj cGwK7e2+t0u7uHt+PrSwYi3Zw0bgzwYmrbG5D8lMjHUpBf+emwO7MyA/MDa/COhhAUO4 ryJSkssHwMW5n9lJrxt5QddprE7+DLay313ZaGAmD3ws4PIka+Mu3F5HvcK3LsxChu4A CsPsYmlz8EWUWsh1XHBr8xHT9U+NudeXGiUn7LwRIQPDMfHlVqbX1NLsNgQa0UJ/DbUG FdEg== X-Gm-Message-State: APzg51AsRGeLoBrSV/0ta+vUMOQycyzCW9rTRdYNWJyMnWzCyzR8Dre4 iyoYnoKmzTFkwWv/sq7zn3b54w== X-Google-Smtp-Source: ANB0Vdapq2HIuNL3DNdXGZEB1vlk641ctOTi/lbV73isDueWvy8Rk6v1tIBTClHeuAsIawblUE4pHw== X-Received: by 2002:a02:270f:: with SMTP id g15-v6mr23247551jaa.94.1537219189976; Mon, 17 Sep 2018 14:19:49 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Capturing STDOUT without subshells or file I/O From: dana In-Reply-To: Date: Mon, 17 Sep 2018 16:19:48 -0500 Cc: zsh-users@zsh.org, Daniel Shahaf , Joey Pabalinas Content-Transfer-Encoding: quoted-printable Message-Id: <61C90346-A07B-49A7-8062-DF5AA614F133@dana.is> References: <04a12c6a-c926-b088-f386-8a2bdb81dad2@gmail.com> <20180903140214.76kbzgpfru6atc5u@tarpaulin.shahaf.local2> <20180903184353.yzujt7ywnlvufeye@gmail.com> To: Ben Klein X-Mailer: Apple Mail (2.3445.9.1) On 17 Sep 2018, at 15:13, Ben Klein 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