From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16856 invoked from network); 19 Nov 2022 18:18:56 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Nov 2022 18:18:56 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668881936; b=VmnD9DVj5csVOjWEc48jfB06b+0Sgjg2GgtDUdvoIn/MTUhbW2de3uetCgjNuO//L+wlDq7cHP ODsZzHc381eeq1fkE71H4AVqMa84F4KM7WVS+OLnv/wFhJrV+f0S9nRuuR2DodCV4Q6Eszdswj lyE4R/wumjzNcE7IYQWS5xdGxwG03dtjlAsar08ys5/8Eb6yd3zx1s/hrscMwBN7td2QYTFkxK WxF8uGKyBxRDaZXMZAOCnbiK6v1NjyJQ5z0d9+TN5/whOL12BaNvIbEwP3V/wBK0JlljVOyJwb +7g7YoBmspQAHdjp1AJdWTmmsDUJls7hx6oqNDTiG3PeIQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f177.google.com) smtp.remote-ip=209.85.219.177; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668881936; bh=U1fubzooFxGI9dTFkKt2FTuFERrOtFpirxGaUOoXLLs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=loXJC9wJ36Zu4PvPH3HlTRfNr8frxzw3XIbUr/x9fcL/C1bR6E72l18dwa9H9VkRL9GXLLBCHW qvuODQ5KDpMRS4/9Z3jTrXcNYG/Zj4HS82chY3JySppJPWl1EYue61vtIjjoOCbgpLMFTDfxg8 dVJPoGwbdB8VBHzEAKnqioLAi0ojZzaR11YDEU2KF9uZnrf9DpLk7QsSGRiedpdajgRpYo48LW TQf2tLCs/wEwUZKdkhjqzU1rMCgAFinix3Sjzz2oqY6rIDxvUJscIRE5SIIxnIBfVhEKrphAMR SiDHWZ4mWLm+u1sf6MTSr8Uq+wQpWAKKj/qfZOyHQ5AfcQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Aq/pXuzrnnV1NzOUOEApQeDyXRU5dM5zn6Twn63DTKs=; b=hqrM2qX791BoOSRVcoa+//Otub OP9SKYwAndB+34iul48F+wSpVagPa7alx9fQlr6Rs0byUFAur9JTCTD5JImHFCJthvoCKmzdvoVNR mVj70EKPhJt+v6mJT/7BDrTU8Kopb3oHvNz3aPP33m/Mv981xWD+XA9PfV9x7+9jvDaORNIcRGV52 T486R5oZaQ/VL7nD0kv3faAkMEdQj7jr0N0QuB6JolgBdQr5hvXRrPSkqK0hGiXK3kHtxcY/q7bs1 UsJVX29p38b4+b8zhYRF6Zp9Oi0UvRIe4zzDl+mTeLSiAh2v0/8ARl6y9yOt0bPwdIDcCHw1s4XUt JOiXOPLg==; Received: by zero.zsh.org with local id 1owSQa-000AnA-24; Sat, 19 Nov 2022 18:18:56 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f177.google.com) smtp.remote-ip=209.85.219.177; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f177.google.com ([209.85.219.177]:34706) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1owSPy-000A84-Hz; Sat, 19 Nov 2022 18:18:18 +0000 Received: by mail-yb1-f177.google.com with SMTP id c15so9260985ybf.1 for ; Sat, 19 Nov 2022 10:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Aq/pXuzrnnV1NzOUOEApQeDyXRU5dM5zn6Twn63DTKs=; b=Bk92EYdAub9vuUsiWvKFkF6vJrOuVen4o51roKBYhlw+EfwS38FL7I01gzkk1E1C/5 TzF1+rZMKx8Fn/06YSq2NMJdm1hwt9yEchpJHILCdZ7Xz05Q19okAWmL4Xq+4JSVOuU4 /a/DULB5jqSvpSDYIXWTfxHeAxsLtUzL0ZkU88GE/JN6DTKbp9Cb80yO3nbhmph3EPQH tONJuMci1rZiizewoXbtiDXA104Nzh8iADko2fa8zC4MqOaEpZ3N192/WXNDzRnBLIax sVlyBD8vJYe57j0AWq7leCfwC/VMyJjNTc/Md4ho0eSSALNTZIJgNqYQPsGmn5t0Sr1G HIgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Aq/pXuzrnnV1NzOUOEApQeDyXRU5dM5zn6Twn63DTKs=; b=cUpVpbR58sG0PXT6/swSSXGDw8a5fFlX9z+2QKPJg+KGH5HNEMlZ4f8+zVU3ftgUYB OLWTiBbaDaupottE7nz3TNaiXZ6udoMULip9tAwbBXefDRrVM7isqNCcX4M+fv2s/j4J tM5eFKffIo81rnSwH/IbIUkrcR8FF2Zfi8JdZpP0DojBfPN59vihKFF8ci1MH+Uc7i8R ksKYPfmWAiKo9xPYLiwjUnn7gqvN+AG5QjXdxbQx67ac65N4saoy4ZEbIlQCDOlp2o7K 6UQDIIMYfKElcwy8S/Yy4Do+giuct8STLlFkhQJJn3Lk32bTo5u0ocLSMT8w/ftLpPJW JOBw== X-Gm-Message-State: ANoB5pk/w2TvH2wrvVy9InpSnPV31Ro1tRTEDNXxP6ygTWUZjQA9XTRR O7A0K+zw29GmY+xXmbC0mOuUWlwp3ajgNfqKvvtW7HqWfco= X-Google-Smtp-Source: AA0mqf4tdzLfobFh0iwWpm8qI52xZdPDMgRJwg8kNKoyzfAYqlgrYXX1tYe+w4q9MI0Csiv0MZzameQjtPDmErCI3lA= X-Received: by 2002:a25:6814:0:b0:6e6:f7c6:4e37 with SMTP id d20-20020a256814000000b006e6f7c64e37mr11830444ybc.476.1668881897106; Sat, 19 Nov 2022 10:18:17 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sat, 19 Nov 2022 19:18:03 +0100 Message-ID: Subject: Re: why is eval needed? To: Clinton Bunch Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28415 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Sat, Nov 19, 2022 at 7:03 PM Clinton Bunch wrote: > > Another option is > > local level='-L 2' > > tree $=level If you really have to use a scalar instead of an array and then split it, then doing the following is usually the way to go: local args=(${(z)level}) tree "${(@Q)args}" This allows you to pass quoted and empty arguments: level='foo "bar baz" "" qux' Note that if you combine the two expansions into one ("${(@Q)${(@z)level}}"), you'll have incorrect results when $level is empty. You can do the reverse transformation--from array to scalar--like this: local array=(...) local scalar=${(@q)array} Roman.