From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 16DA1247AA for ; Sun, 21 Apr 2024 18:15:30 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1713716130; b=q1kDRV7IXHA9o/slmJoEv4ESoYjMIVPRXHnJXaP4Yssln3zPDaXHbyYLfWTVYYaogWY3OzA59Y EnhLrxL3yBMGeSdKQYhhzpIk057xgy2xDUfSRdaC2FVVopsvLYpWsud/zLYPU3cFmSNZV2YnMW MsrNPhSy3hI8ZTFX32CCGqLVOkBa0T8D9o2blqycpNx9jsn6yjpTjUs+3pwrGsDz0gm3zPqOYt IMJv8E8/43npsSxCPhxTwOE61mQY9aQkgZJXxf1Jfm0QvakFEVCOKiB7Y7HyEiLhVa1pNP9/v4 fqZXPP1IxH+Stmmndn5Xq+f7DiW/Je53qGbSaCnmXE33Qg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1713716130; bh=WtxSFlH2iLS8NYqSvXZXTEFIa21tYKdTVfYqsDXbmRg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature; b=Pwx5VBVhovmMqJnz31muO5Y6kMzSHzhOxeR5Clj0EaCL0G5OHgPWxbSYSzIE/TqCf2paLYsnPt YXjcrFq8wtX/ltB57YTmlw+cjoMnX/eYR7CHiK6A8jMJGzXEDbKajvLqUHXT40Q9sDsydCp/RV r2cSKhlGCbZHq7aAyxRvNqSlKQakH6B+9HSw1reFmqM/OE1XYzcMxv2jYzT7P3gOVHdlFPqoQu tFJ7lKqd0Ac0bGC1VNgHawfg+VfU8hPazo1L/jFdrPPS2GO97DwDBsuKEemdBU5+J8KtF6Rtmk bHRPvvFSQe/iAT0S0ht4CDf7Ek/H2xOklWYbdDZ8YereUw==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=+L3zGMmOsJ3/EsgmPZkUVgs25y3ICVtZdhMgrxgxyQU=; b=SrrRHcxbdOj9TwnNv3iRygeSzR aYmTiSYUy1JHFUdjde/BjzsgB29PWemSqyuh6iSWVfVtRLeN+0RZ/w70NcBmRsZPm3yomDlLZIlj8 ftUi0N8U5LQ9kGZklkVGZApydreceAoOWRRSZ0BCBlmqn0hjNmb0EX+QaRmEs2oq88HZ5fqGOMMXb 43MBXC5/+50D1SmRwEUSYY8OeoQfE+rztLuq+vQyrQHdepUf/1R0YQ9/kRD/uPmc+E1H6nfkPd3kA dysW8r9liwQBS9lhcZK9eedFlDec65tOaT0DtYzR4C4cgjV4VlqQAgA7EmrdkDiYOQE0ASXzzlVJJ Zy2B2uCA==; Received: by zero.zsh.org with local id 1ryZqj-000L2W-ES; Sun, 21 Apr 2024 16:15:29 +0000 Authentication-Results: zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none Received: from relay2-d.mail.gandi.net ([217.70.183.194]:43375) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1ryZpy-000KJG-LM; Sun, 21 Apr 2024 16:14:44 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 7628240002; Sun, 21 Apr 2024 16:14:41 +0000 (UTC) Date: Sun, 21 Apr 2024 17:14:40 +0100 From: Stephane Chazelas To: Roman Perepelitsa Cc: Ray Andrews , zsh-users@zsh.org Subject: Re: optimal expansions? Message-ID: <20240421161440.jicmznwxqb6pz2fg@chazelas.org> Mail-Followup-To: Roman Perepelitsa , Ray Andrews , zsh-users@zsh.org References: <53fab6be-26d7-4de5-844f-ffc295d9a494@eastlink.ca> <3d15311d-b5fa-4a55-a17e-e61fcdded7d0@eastlink.ca> <9fe68299-c89f-46a1-b10f-eefadd03a262@eastlink.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-GND-Sasl: stephane@chazelas.org X-Seq: 29850 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: 2024-04-21 16:19:24 +0200, Roman Perepelitsa: > On Sun, Apr 21, 2024 at 4:10 PM Ray Andrews wrote: > > > > On 2024-04-21 05:23, Roman Perepelitsa wrote: > > > > Seems we want '-r' most of the time. And the '--' should always be there. > > > > The missing `-r` is a bug. It should be there. The `--` in this case > > is optional because the positional argument cannot start with a dash. > > > > But the '--' is good standard practice, yes? > > You can call it that. It's one of those standard practices that I > don't follow, but if you find the trade-off palatable, go for it. [...] I would urge you to reconsider, especially for the "print" built-in of zsh. print $external_data or print -r $external_data is a command injection vulnerability. $ external_data='-vpsvar[1$(reboot)]' zsh -c 'print -r $external_data' System going down for reboot now. (I have actually singled-out zsh's print for that at https://unix.stackexchange.com/questions/11376/what-does-double-dash-double-hyphen-mean/590210#590210) -- Stephane