From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17713 invoked by alias); 7 Nov 2015 15:35:53 -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: 20916 Received: (qmail 22303 invoked from network); 7 Nov 2015 15:35:51 -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=NKvc7L9z7/b0bXwZ1ZmuGA==:117 a=NKvc7L9z7/b0bXwZ1ZmuGA==:17 a=IkcTkHD0fZMA:10 a=zLSLHuIiqI2y-RQ37OIA:9 a=QEXdDO2ut3YA:10 Message-id: <563E1A54.4000805@eastlink.ca> Date: Sat, 07 Nov 2015 07:35:48 -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: convolutions References: <563D5ED5.1070102@eastlink.ca> <563D974B.3000308@eastlink.ca> In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit On 11/06/2015 10:38 PM, Mikael Magnusson wrote: > No, because 'expanding into "\e"' means nothing useful, did you mean a > literal backslash followed by an e, or a literal escape? It's not arguable sir. If you found it vague, then you found it vague, but to me: " \e[31;1m " ... is very obviously a color code which I hold in my variable " ${red} " and I want to expand it inside a file. > If you store the string in a parameter and echo that parameter, the > color variables also don't expand. >> So you have a file with "${red}" in it, and you want to read in the >> file, and substitute the value of any parameter references. Exactly. >> Moreover, >> these parameters are not defined in the file, but are set in the shell >> environment and you happen to know that they are string >> representations of color escape sequences, and you want to expand >> these as well. Of course. Who but me knows what's in my environment variables? >> If your file has a semicolon in it somewhere, then your command will >> run arbitrary code. Bart's example doesn't have that exact problem, >> but will still execute code if there are things like $(command) in the >> file. >> Yes, I know how dangerous eval is, that's why I'm asking for a better idea--some way of expanding parameters inside a file. Not just color variables really, any variables.