From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14162 invoked by alias); 3 Sep 2018 14:02:20 -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: 23603 Received: (qmail 22559 invoked by uid 1010); 3 Sep 2018 14:02:20 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.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(66.111.4.25):SA:0(-2.6/5.0):. Processed in 0.47501 secs); 03 Sep 2018 14:02:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=e+zQmcS9wtV+w993S+vk2YKnsyql1 HjsS0z2YgOqUPY=; b=PBRrKfKUQqWayUVn5oSYSvfkR+bHTTXV9zaoKW6CyKKMy NV5nPbXs6xBKinXk0tIaiGJK1jTC7s09xqbbizPvSAIsnBKhlGAz+1xBwc+qRsvd ksCCoyD0Kv2JytkZ2UNcNJmHvamlWu6nn6T15x0ePAN71w5LDLhLDtm0Q7Jw778b dLXwM5PnUEPsAIQ6JrT2scXro0eu/MEPR34vMszDI6gTMhL3m24BtxysucrksFVX NxfdmstpGHz5Yv5Z62/2wJjq/Ni9YHPfxHeUkHoN5PKJmFNjmQs1ZDt0wFJZkoRp sUbMZLcxpsDQIHq82YcTSfBdHUVWSzCFOl/soWmYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=e+zQmcS9wtV+w993S+vk2YKnsyql1 HjsS0z2YgOqUPY=; b=DHJm7DRwIDIb2/xojYs2dbgmACtsC3VW43m3JVIE92c3i PvmesW8sXZXZuFtjO+aoOEzl+stOH6D6IMWTxQGIg/pOq/+zUCyt6+6JFNvVh8F/ vj3ppy3Y9rS44WzhL6QnIXSCDyCeEr6EYeYhT1vdIs0eafgKIwR/ALQ1AelE3zqh SQZ/0+e5JbjXT3usOSBj8m6kQckUhmgqZ6M4wky7jUICUwjPoOQsEsBNntmD+2GG EDWcKaRFemP7jCk+6PzEqVCf+qmIiNNZktY+1+yqhIPgeI8O/W4bMhnoHGyn9kzA tm8JRaknOoVbZn6PhCP/oZtZQgCZyAWqqv6InEV/g== X-ME-Proxy: X-ME-Sender: Date: Mon, 3 Sep 2018 14:02:14 +0000 From: Daniel Shahaf To: Ben Klein Cc: zsh-users@zsh.org Subject: Re: Capturing STDOUT without subshells or file I/O Message-ID: <20180903140214.76kbzgpfru6atc5u@tarpaulin.shahaf.local2> References: <04a12c6a-c926-b088-f386-8a2bdb81dad2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04a12c6a-c926-b088-f386-8a2bdb81dad2@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Ben Klein wrote on Sun, Sep 02, 2018 at 16:57:49 -0400: > I have an interesting predicament, I with to capture the STDOUT (builtin > printf) of a ZSH function to a variable, in which the function should be > running in the current shell context. Just pass -v to the builtin printf, e.g., % printf -v foo 'a%03d' 42 % typeset -p foo a042 %