From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9926 invoked by alias); 7 Nov 2015 06:38:42 -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: 20910 Received: (qmail 28956 invoked from network); 7 Nov 2015 06:38:40 -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,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ImCZVz7GHiCq81mllANyVwIgTV23P2M7wWOWXyY46ns=; b=gFjCSGrwZXOXck6ds7SD7RrVKxCLmPb9iw+Mr68aEivl4n2SayMPfr0jeyB6WVmrfk Ot75qRpRXaOCthQ6SjcRE8wIVO1wx5QjqMyBN+yklHkTy4G/Q0sVwv78NiR4H0BwZ/Ej WA5JGwgOAh0Zgjz6O9lDkI0eTl3qQMwrE0zJ2SDmO0JcmDhBlGM6hkWQ087y5zsSM236 lhHvGAHplyy8juXnqAktyASo7Z2fNDKC6Zdm9fhTNs4ydLdLj7dsNSLNCHdgt6aVfb+H gDvkwieGkJWmxkCmMHWTjmKYXep/2LnAsN/79AciY2eEZLujaOWKeBYzCqEWjriZv94/ JyTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ImCZVz7GHiCq81mllANyVwIgTV23P2M7wWOWXyY46ns=; b=EizTLRDW7aA7duJQsam9HzxsYC4srBKL13P3nUqwN3p7VjBhJeWP9ZkMh4yiABEz0A DCqNyc64/G6DLffJ0KsbHo7M0NcpMnNK/IInxxO5A3ziFjSlrfX8ACg8NoyDPmhFjkaa c8/z2ynfmsSZZ+NWJYPjBqM5SUtBeSHqC449BCPtAuwRJAjeJ0lkWIv+Oa+ujQYSUenO tpTjGqKG+6nE29IHFsqT2K3Js0LnXKfVSGVpSzJXb+9jYOCs2FfIJ0UlzyiZDmntXuoL hWC/kjyZ7lmdCAAqVj+WZqw1izgExmVsGXnWvgQ/oE6Gq6GcO8eT3Z6O/s+veXWxytW4 SmfQ== X-Gm-Message-State: ALoCoQn1otBc11Hi/85QlzCcwHD/0ChxFzsEkOGWN0WUDHKUaP8BWU3vHNElpFT2cva05c1QDn3q MIME-Version: 1.0 X-Received: by 10.28.18.194 with SMTP id 185mr13300629wms.44.1446874687068; Fri, 06 Nov 2015 21:38:07 -0800 (PST) In-Reply-To: <563D5ED5.1070102@eastlink.ca> References: <563D5ED5.1070102@eastlink.ca> Date: Fri, 6 Nov 2015 21:38:07 -0800 Message-ID: Subject: Re: convolutions From: Bart Schaefer To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Fri, Nov 6, 2015 at 6:15 PM, Ray Andrews wrote: > Gentlemen: > > echo "$(eval echo "\${$(cat in_file)}")" >! out_file > > That's the best I've been able to do expanding color variables, eg. " ${red} > " into their native " \e[31;1m " in a file. Just as an aside, this is the second code example you've posted recently that can't possibly work in practice. I can only assume you're mis-transcribing in an attempt to simplify whatever your real code is. If I understand this correctly, you have a file that contains text which looks like The following ${fg[red]}text is red${reset_color} and this is not and you want to end up with the variables expanded in out_file as the actual escape sequences? print -R "${(e)$(| out_file Of course that will also replace other possible expansions that may appear in the text of in_file. If you really want to replace exactly and only the specific references to color variables, you need something like Zyx's sed expression.