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 12496 invoked from network); 21 Jul 2022 00:18:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2022 00:18:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1658362713; b=bQ1i9wQv2JCnLHarcMsmdC2Oa1pMuSnLOVkZ8vQfHODwbN1iZvqETpYWxRJ8pnTjLBvvy8EjDO KajxAOwu5/4JENsOpbUrZPusOBMqgiJqlMOWPSeIz4Jq2N0r4QsBc0wD+GkQV5E/+4ECB6HvTN N/x0sAqfYY0+AgRo5HBz/zcnfuaQ4eBdoF4kZ2oB9BgRyZZqSfXytQuQy2JmhNPHT4A2Chooz3 zKMggPI9Q25odsUsD8sD2cv/kQkwJVxz5PFnqqLgdd1+mQ3ugbEelD+z9UXFAsNUQLvui7iM3F 5CvieFOGmPmS98IirJSmx8MgUL3AZDUYMqoI+ApJ0oQ3qA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout3-smtp.messagingengine.com) smtp.remote-ip=64.147.123.19; dkim=pass header.d=ajrh.net header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=ajrh.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1658362713; bh=3Hr1PSh5rMa7fvcksq+CKa6IOMtcw46tnD27qJbnrks=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Subject:To:From:Date:References:In-Reply-To: Message-ID:MIME-Version:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=l0dIa8Sxfm5gd1tC3j/Tki2IxjCAFhBQnjlx+54umlVX9eTB4hbjEA4bUmiqalIivX7SHL+qDB X6cEX6b04+Mwe1VOmIQraIKV8tlbFVcI9TxpS/DEnaQHdLEdum2KfBqUXJFr29TLrmaqSB5Sov 4C1ic8UBYr/GOxU74uqEayzmVmMgwIbif05xX279FDHm38CuuAMS3hMFBgEhUbLERxRC8Ll6KS 4u7nB8aus7ZXAEc7p/9cMHztO/A4iUwjMtZu4JqEvV3E6pean5rEKiWImc9bCMlDmKARFKhyYI PWxrCs2cuPJ8zPY5Bh5N5+nKR/CShYC/CFq9KMhaQFqQRg==; 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:Subject:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=c87hnPXs9v91H/5b7D7rKD7XdsR51+AAi/+eOa3wHMs=; b=Wd7UxUaiGNzO3qpDAsAxPAjqQp IQiAjuTmAsd4F50HQYeLYCVjq4I23HesfS1oLvFfueiGR2FMqlPDJhhwr/xZjJ9wnjFrfNAWdUJ5S 0MpZ/5b/pOUYt15W91Llrozm84u5QdSu+XFq+zuOk/i2gW4pNHQtj/Y4WMOO4gy9MO+3UwXkx06Xq FUxnBKMve3FDEYpX5uG3fTK0gYPFaWhX2mc63wrhLe4m1lwSZ3j/zd2ds12qTu0phOja37it5E00E kzYEu6Xy4VLCp2J2YQu2RaSVMX2BE1KGkdcn74RHt1JFbEVQ+DG0WD3uiGkkw9FIjGUFakEfkKqDg hWuRAfeg==; Received: from authenticated user by zero.zsh.org with local id 1oEJtg-0006U6-4e; Thu, 21 Jul 2022 00:18:32 +0000 Authentication-Results: zsh.org; iprev=pass (wout3-smtp.messagingengine.com) smtp.remote-ip=64.147.123.19; dkim=pass header.d=ajrh.net header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=ajrh.net; arc=none Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:40927) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oEJsQ-0005nx-5N; Thu, 21 Jul 2022 00:17:15 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A349E320090F for ; Wed, 20 Jul 2022 20:17:11 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Wed, 20 Jul 2022 20:17:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ajrh.net; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1658362631; x=1658449031; bh=c87hnPXs9v 91H/5b7D7rKD7XdsR51+AAi/+eOa3wHMs=; b=KAXcnL3EBkhbpUGDS7t6UaNGJz ObyluZN+uALLo+avcyUov9I0cje/OOoAuiuLZpcjkj2Bq04QB2ZuHKCmsYAvbsjF 4S8PR8fBVft9ZhhY9j4o3ey3baey2ET9fadJ5LGQ50SdPDwwZozkdI+kKbninqsZ s9MKj7jInXO0c8QU/yvI9KCjaDyKs+9kG6ldqEbjoAOGWz+hxo3BC0o1XjeLdM0A qEppYi+X8eTd5BX8M111gpewC5ug+H43MEuhhfobm4+9u1gmpFQm4+KMVdwDxGKF XIHaL6wrjl4N7ITHdve3ACd5Rzt3FOtpK+/tTzRTZ6vbQmzJh5M3Isvt/JWQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1658362631; x=1658449031; bh=c87hnPXs9v91H/5b7D7rKD7XdsR5 1+AAi/+eOa3wHMs=; b=p7XnJl2+YynInHNlaJfS6xfA1jRSzycajd/BvRIp+dE6 gZaAngz/Vr+LdKuXmiyUGW+3Zvz6I5TkjazRJ+rdzL2K15Th6Ixlkfm3wGrtiBiZ 3KGUD/nJpN0PrGkPvQs/V5ykO+NovN03y3J7FXYPdneWsfjclG0ilueD8BYfLZ76 N3l0kL/NGkul+HnbeJ1wJQaYDDsb5t+zN68N2vgoos3SoWel89du2hFC1H+YOTX8 muuIMl0uaV5JzZmoIgAzmRL+tNq/I0y+Zn2r8ozdqrGs2kUtnIIKE5nchPldKZR8 gydOVnRMQ9kqBAnoK3PIXeBkEnkqW36lgPHSjlwBuw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudelfedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedftehnthhhohhnhicujfgvrgguihhnghdfuceorghjrhhh segrjhhrhhdrnhgvtheqnecuggftrfgrthhtvghrnheplefhvdejiefgfefhledvvedute eileefgfdvleehueeuieduffevtedttdejveeknecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprghjrhhhsegrjhhrhhdrnhgvth X-ME-Proxy: Feedback-ID: i6aa94791:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9C1A915A0087; Wed, 20 Jul 2022 20:17:10 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-755-g3e1da8b93f-fm-20220708.002-g3e1da8b9 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <28c00da7-cfdd-4f58-a539-8deebbe5dfa5@www.fastmail.com> Date: Wed, 20 Jul 2022 20:15:59 -0400 From: "Anthony Heading" To: zsh-users@zsh.org Subject: Re: view onto command pipeline? Content-Type: text/plain X-Seq: 27909 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 Wed, Jul 20, 2022, at 7:37 AM, Dominik Vogt wrote: > command git "${opts[@]}" "$@" > As a rule of thumb, _never_ use unquoted variables in shell scripts That's a very unequivocal rule-of-thumb then :-). For me, zsh's word-splitting rule is one of its best features, and I think anyone who turns it off deserves all their pain! Agree quoting $@ makes sense here since this is a wrapper, but I find more often dropping empty arguments is often very helpful after splits and suchlike. But as to "${opts[@]}"... Just too ugly to do that all the time, no? Instead, use zsh's awesome sticky emulation: emulate zsh -c 'autoload -Uz ~/my-zsh-funcs/*' Very helpful for insulating the risks of unexpected option settings, and makes it safe to use unquoted variables. As a rule of thumb, at least :-)