From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19705 invoked by alias); 11 Nov 2015 01:07:34 -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: X-Seq: 20949 Received: (qmail 18190 invoked from network); 11 Nov 2015 01:07:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=Rb7dudWe+J2gL+/7yVpO1Q==:117 a=Rb7dudWe+J2gL+/7yVpO1Q==:17 a=N659UExz7-8A:10 a=jt2NiyqxjzvH1zRyotQA:9 a=pILNOxqGKmIA:10 Message-id: <564294D2.6050201@eastlink.ca> Date: Tue, 10 Nov 2015 17:07:30 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: saved from prince of eval References: <563F8168.5080006@eastlink.ca> <151108115752.ZM859@torch.brasslantern.com> <563FC6D6.90104@eastlink.ca> <56405E3C.1080609@eastlink.ca> <151109104128.ZM794@torch.brasslantern.com> In-reply-to: <151109104128.ZM794@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 11/09/2015 10:41 AM, Bart Schaefer wrote: > IN[PAGE]=${${(P)IN[list]}[IN[topE],IN[bottomE]]} > Thanks. I've realized that my friend '(e)' was with the Enemy all along. I have a function that prints out a half sane modification of 'set', and sure enough: > } foo="\$${IN[list]}[${IN[topE]}, ${IN[bottomE]}]" > } IN[PAGE]="${(e)foo}" Ended up 'evaling' the content and doubling the size of my environment every time it was run. It's seems strange tho, how can a parameter be set twice (or 16 times) to exactly the same value? But your line above seems, finally, to do what it's asked to do without evaling anything. Speaking of which, we have 'env' which only gives us the--don't know the proper term--lowest level system stuff. And we have 'set' which gives us everything including the kitchen sink. So I have this: #1) strip out the color. #2) cut lines down to 80 chars (some are a thousand). #3) select only things that are probably variables. eenv () { set | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed 's|^\(.\{1,80\}\).*|\1|' | grep --binary-files=text '=' } ... which is an effort to display just the current parameters. However the output refuses to open in any of my editors if piped to a file, they all think it's binary. Looking at it in hex, I see that it's a soup of backslashes and single quotes. Why is that? Is there a civilized way of listing all current parameters that's just plain text, no backslashes? Not knowing the hierarchy, perhaps even avoiding those deep things like 'color=' which isn't something one wants to look at very often--those deep internal things that have nothing to do with the user. It would be a useful thing.