From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 727209d0 for ; Tue, 30 Jul 2019 14:56:45 +0000 (UTC) Received: (qmail 18399 invoked by alias); 30 Jul 2019 14:56:38 -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: 24118 Received: (qmail 22220 invoked by uid 1010); 30 Jul 2019 14:56:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk1-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(209.85.221.170):SA:0(-2.0/5.0):. Processed in 2.395391 secs); 30 Jul 2019 14:56:38 -0000 X-Envelope-From: pierpaolog@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.170 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vWzJTaCmw7UTVr2TDGhC2uFO1YC8q4fgW10lYgczgP8=; b=FrSdzt2pagss30uolLgLwzsZKz9pxTdyNuxlflY1sOqsjWbAjRGHi2pnjuVpInttOO HO7Jb+JCtuA7PQb94SqVdTjSP3DRrkpShsZJ4N4gRIPBkxY0l4L88vhPi2Kkk97CdTEs 6hQLy3Y24FHMufCHHSjiXN4goc1+GKWB8SN4g9k2hu6+bQ2vU/L2t6X7HfxZSXqEKJTg UyTkaCHYgmNop4bz1Na+0peNAQBz73gMueqVhWmDGV9Zr1fsczLPzRUhJQ4BorLcdaw6 03w+EismgbT03N5CQbs5oUVWMtL2COMr9GTtWRtIlM7MEAX3j9WzbSxXSIUUtXiZpSHv ZRVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vWzJTaCmw7UTVr2TDGhC2uFO1YC8q4fgW10lYgczgP8=; b=c13nlaRmPQGnOKw4YeUNohy3oNia46Y0Qgse+al5xgUn/u/ZtXUI/v0VGpC39LkvXJ kz8XjBfi0b7mKdjfwkiG2ubz3mHZM8RpnEcv8gXbTTylhx27ZJlM9VRPO0we9lJTvVIq TDNnQYImuHNqz+k4AI23Bp1pEjE7zSCNS7Juvo+3FGbZb9t45Cq8TDwfVsHY2hmwSMCk GHPLVa7N83RSEjvXQntsa3H2sINnASnYesKXokmMto0DXkJxMHqUomsPQMoNqft2lESV W2k59/b4vJj39ZFjjoIKxW80MXdw7iDw6OmkVfljVuJvCaaI7vvqVLUU2RozCl78Eh0r EaEQ== X-Gm-Message-State: APjAAAUfa0phBy68ygGPNbQybYk0sEHZl2iLf9V8oJt6n/SKMFx0IXlQ yiSsvgh7CsfKtcuvoJ0P6OdtxCC2to5MXht6WiE= X-Google-Smtp-Source: APXvYqw9NZBiiEUtOE+OtPmCRQeeuyuKg2QIFR/D/U0ifFV8qSs/FpPpsb/2MUdrckXFPRfU1/dj3hVzeVMIeLUd93Q= X-Received: by 2002:a1f:7c8e:: with SMTP id x136mr44861899vkc.27.1564498562965; Tue, 30 Jul 2019 07:56:02 -0700 (PDT) MIME-Version: 1.0 References: <1564492687.5815.4.camel@samsung.com> <1564496130.5815.9.camel@samsung.com> <1564496596.5815.10.camel@samsung.com> In-Reply-To: <1564496596.5815.10.camel@samsung.com> From: Pier Paolo Grassi Date: Tue, 30 Jul 2019 16:55:26 +0200 Message-ID: Subject: Re: variable expansion inside string To: Peter Stephenson Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="00000000000018e565058ee735c8" --00000000000018e565058ee735c8 Content-Type: text/plain; charset="UTF-8" thanks Peter, for my use case it actually works really nice this way. I was hoping for something that wouldn't allow arbitrary command execution for future uses, but I guess that would need a proper templating system of sorts best regards Pier Paolo Grassi linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217 founder: https://www.meetup.com/it-IT/Machine-Learning-TO Il giorno mar 30 lug 2019 alle ore 16:24 Peter Stephenson < p.stephenson@samsung.com> ha scritto: > On Tue, 2019-07-30 at 15:15 +0100, Peter Stephenson wrote: > > The nearest I can think of is: > > > > print -r -- "${(e):-$a}" > > Or, actually, a straight > > print -r -- "${(e)a}" > > since you don't need to add any text to the variable substitution. > > pws > > > --00000000000018e565058ee735c8--