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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24408 invoked from network); 10 Feb 2021 22:14:42 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Feb 2021 22:14:42 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1612995282; b=cODMvciSfwqBIjlH5hd49I8XsKnIu1j83Fny7PB/OHWYxodbHMKbf4hAhNpT6UCcdZWp2cMA1A Tkah4VkQONymQ8y+tUGvkxjX39olXDR1nRiYombfpdwj3Oay1qYeE82vhN7zJw3DjXUb0Lxckn nG+nGnFM/l3s5wwcq1CdU+r2/4AxfZOylDVaYTkaD/ZTcP5rgdfPol0UzRjYvLCxutKvcAP8gL vIpjK0TTaST2vczYQJMxPiE0m2vdrOflbvyuNAES5W4UF8lhRly8fPr7lOBQcDMazw5m8Vn4Ad oDM0MvbIqW5zJZhgyNmWPkRc6kLLdnI/8uE9ISGJHyvqhQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f54.google.com) smtp.remote-ip=209.85.210.54; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1612995282; bh=WwtgugBGpnKM74RNMpkgYuQgmgMyBy8zzk/ERM0N638=; 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=AAT8BBySCAAELsLuSDZ0NILj+0ccexSgRSVeceoMYCw+AvUYUBcYqFIIujWiXPvSjP7U4lh5Iw pGqKTNrqeyLIxByK/vvHCp6gld94Si7lOa0aqBQ/yaCFXD2SSrkM7xJOVDJe+56Q2ZrCLc0v0W EwntJ4nmNk4mF7Ydi1rgl/dB/B7jbiz5pOtc9G/9Vl46T194swhqwWl5fgMclHNq7St+SEKJlf V5fleytUpbSLqQ5Nui0Ui6I9nqRUpPsmF3NpFfAzmCQHP1eAiMHG5vNbrKu38b/Fw27934tC0P f5LPgY7ouriEbNXAr+CEgCLTE2I0P+XB9JuVZ1TX4WbktA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=WwtgugBGpnKM74RNMpkgYuQgmgMyBy8zzk/ERM0N638=; b=acrmrJLDAqn/gibPwUTbFRD3al QBUidQAC8fxQx4Kwkx7iXWIUP/Opia7Ekg0zCIiJI6etZ+QJ4RAUp9UfVixfagwwcq952tXXh5R/T pkq4eRk036K+AeYmBEODdBKC16BlPfOjIHC3vbamviGk6G9dO+HIjjap1Lq67no4r2PjR+FbA2jF9 cbospyM+0pjugOqUToZZc7u+BQHjzfC6EH7+qIK/SDCgpu2Li4KG1uazQfCbtT8+hLQM9ewdGOPUl bhCGHo6/U0AqpuHRzCJcMC0cM3ARDoZF2azULe5ibv7kAT0TqDXuYSx0+BHb9p1aRtc3Fv1rzpUZI KXkNEKcA==; Received: from authenticated user by zero.zsh.org with local id 1l9xkv-000PRZ-93; Wed, 10 Feb 2021 22:14:41 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f54.google.com) smtp.remote-ip=209.85.210.54; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f54.google.com ([209.85.210.54]:34327) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l9xkS-000P4s-Ni; Wed, 10 Feb 2021 22:14:13 +0000 Received: by mail-ot1-f54.google.com with SMTP id y11so3389128otq.1 for ; Wed, 10 Feb 2021 14:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WwtgugBGpnKM74RNMpkgYuQgmgMyBy8zzk/ERM0N638=; b=xGlNDeFLS8Vbuz9QlZA77vUjpB9SM94FIQAvIcTHRczlCarHNxzO8/lIAgZHAtHfMe +GpsQj5sC6km5yL3t97FiWdnl3N5jmJ3WK7bMTaBfyAh1UtFXvRfT6Quc8P9JqbYV/1M 6z3fBehJmNUMJNoqAT/oEv37fy5GFiNJGFGt8BaMwzcA2xBbIiDyK89c7WzSd9ENbUVt WoMxAYB9Psh2DKo2O03GsaZPfzg37jPj8hoTGl2m/fDb+2e7dxhW/zIWlwD5q0tHMxt6 0cAuwA7oif0/UQppLrLiBkgQLX2aFNfFQcWwgdHgnT0HyOpN0xQWZKksphTUElxLmDm1 bx7Q== 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=WwtgugBGpnKM74RNMpkgYuQgmgMyBy8zzk/ERM0N638=; b=Mu93kcyNWweOTpfquxP2+Zh53gKT5h7JwdGSwbftFabVg06HfrcqSYJzCIeGL2y5tS SRS6a0CTCqLw683v7evqkEVq0TfC+Q6WddPNctV3WdyFhp3ZVJEmMLdBpULGtBePBoXu rVfZCrf33sRAijzJMJzVSKoIct7r4ri7HdDcXdooFxm55Fo3nHJqAp5K2CnxK1o55c3J myUMn4TXa4LeHFc6YncaiCayW6skRSUNYY7VgCxQXwK3RDwbXJpUqyuheOgnIXxe715b rEZx6+yZPS/7sitfEqTtMQ/gedrvawmjPUdURWg4EXybWOemQrRwfPbicajAN+0+t2h2 rLvg== X-Gm-Message-State: AOAM5307AeLhN4Q06V3KJhYjZrOtxeoVkuPaf9OIBWUTqgctLAs38j6/ 4w5xi/xCMgbpEKverSwtDyg//J0rNbpiXjFqZyZIAA== X-Google-Smtp-Source: ABdhPJwx6f9yLqLXfx7RBhD52UII1q+zxLoqqxQXt6XX4xyby7HMVzpSR31Wrr5vatZkjCiGy/FRDApPcp+zsQvmDYs= X-Received: by 2002:a05:6830:2106:: with SMTP id i6mr3689749otc.260.1612995251405; Wed, 10 Feb 2021 14:14:11 -0800 (PST) MIME-Version: 1.0 References: <52D5DA56-397F-40BB-BBA7-CE3BF7256581@larryv.me> <29a203d5-bf53-9cb7-7a49-2705c3b1d8f2@eastlink.ca> <87a6sc3d0c.fsf@lwm.klanderman.net> <752329601.3729797.1612972051119@mail2.virginmedia.com> <379883051.3731455.1612974540761@mail2.virginmedia.com> In-Reply-To: From: Bart Schaefer Date: Wed, 10 Feb 2021 14:14:00 -0800 Message-ID: Subject: Re: protect spaces and/or globs To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26501 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: Archived-At: On Wed, Feb 10, 2021 at 12:54 PM Ray Andrews wrote: > > [...] So I assemble my string, save it > to history (optionally) and then eval it to fire it off. > [...] But the whole show requires the whole command to > exist as a string so it can be saved and thus it needs 'eval' to fire it > off ... unless I'm mistaken. Following on my last message, it should work fine to do print -sr -- "${(@q)sarray}" You probably want (@q-) there, to minimize the number of quoted things, or (@q+) if you use a lot of unicode characters or control strings. Only "print -S" requires a single string argument.