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 23603
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Ben Klein <robobenklein@xxxxxxxxx>
- Subject: Re: Capturing STDOUT without subshells or file I/O
- Date: Mon, 3 Sep 2018 14:02:14 +0000
- Cc: zsh-users@xxxxxxx
- 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==
- In-reply-to: <04a12c6a-c926-b088-f386-8a2bdb81dad2@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>
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
%
Messages sorted by:
Reverse Date,
Date,
Thread,
Author