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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19133 invoked from network); 21 Nov 2020 17:56:54 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Nov 2020 17:56:54 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605981414; b=HPc4HUPGu2JPllgNoLEI2Ch776MNrJ5LVzIHUPDHYi4cOZ4438TFSJZ9ncKMv9wWPyDduQL1Yy wRG11HcfW4Sb+yALA7vqI98VCHaxhV0BsIj9Cxzg7h54Bja/gL6JPibyYF5W7uLGDtAuXtVkFq OwH8rWswgi6kqvzi0zxW4di6yuj/pbtbc/38qDEI7ckNX5qcRor2p7L185jsRc2dILpwL/nf5F OvkPe/UE2/80jDMYaBvVW8nxHS3/4n/QpSmh3hMJMBFCl5v6KrRgf/VJAkA+DpQWrPxtPRCdrE owAQrpxTDYUiwa5amfkKLnsxgKD/iNYgA6s8ZaN1nOAsCA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (know-smtprelay-omc-9.server.virginmedia.net) smtp.remote-ip=80.0.253.73; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605981414; bh=lxRsRfxjHiULrSN8e5GsvG91LeDsVe3w/gWRqtFPJLc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Content-Type: References:In-Reply-To:Date:To:From:Subject:Message-ID:DKIM-Signature: DKIM-Signature; b=Jm4vSG7bxNOQ/ZGtwAl74PtIrNpKLcCtsF67o74kajX0gEq6lATDE3vIISxG9BnDN3VtvRjP5F jluqA5EZWuTcZSoqh2DAQwZsigizatuocF0A2ljQQfT02O9tzbKPguFK5ECSpvaklj6CrHF9VI wTD6AEBJ74/US3pQC42NOTL39Bnysc2oedfEnGUNUX1UEcNTJNqatQxU1+g8DfoEUbr/IHQHlI y7R/EikzMUTlkE+qNe0rpqEBzstzivJuouhfARn8eY6LdCEvKXOtVoOUOYylYx4/xtz/qc+2BN 5sb6SlhkTG0UUSz24M+QZl6NwPxHVT/rD2BuqlMuCjZzBg==; 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-Transfer-Encoding: Mime-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=pMP/baK3YU/s7sFVuqDoQLAiRPM8cCx8nrDCnWG+3xQ=; b=Wk42GnLwQmdQ7o6ITl5lwR7lxd yhAwl+UTqoLDUy0O+xclezI1tUHszIRRt40GSKfPk3KId2hlYfKbWOut5AgEe5w9OloqOfTp9Wt18 vNHaQJgrtoTPO65aBOKpmFlmAYf+SQxNSF0ooIFUvhLT0LKKp6rAOtleqy46VgYJPv4ZkukxH+bGM rDsTXHWCU5Ldv/c1bHm7HyWhnCkZewxFpkKCt/8//HxANW7L3V6kqU273DwDvFO+aPN71bkTWKI4I dM7L/Gf+DhmgfoKlWjBD2EhB6+9+H43XVtg/+HtFljv+Av8SBvP1Lxw15KAxBtxiGMgk4woeKehAN 4Vg8dvOA==; Received: from authenticated user by zero.zsh.org with local id 1kgX80-000H6s-95; Sat, 21 Nov 2020 17:56:52 +0000 Authentication-Results: zsh.org; iprev=pass (know-smtprelay-omc-9.server.virginmedia.net) smtp.remote-ip=80.0.253.73; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from know-smtprelay-omc-9.server.virginmedia.net ([80.0.253.73]:59824) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kgX7k-000GyM-Jw; Sat, 21 Nov 2020 17:56:37 +0000 Received: from pws-Zeus ([82.20.19.64]) by cmsmtp with ESMTPA id gX7jknjnxq8OAgX7jklNHp; Sat, 21 Nov 2020 17:56:35 +0000 X-Originating-IP: [82.20.19.64] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=WuMFz+Xv c=1 sm=1 tr=0 a=FYxK54AnRTbDA0SLc6W5Eg==:117 a=FYxK54AnRTbDA0SLc6W5Eg==:17 a=IkcTkHD0fZMA:10 a=it0Ode7n5dYXB8JIiMMA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1605981395; bh=pMP/baK3YU/s7sFVuqDoQLAiRPM8cCx8nrDCnWG+3xQ=; h=Subject:From:To:Date:In-Reply-To:References; b=1Gndo5apWE8cZC5dJFT7Z2nf3iBkFm5coSPdnmQu/a5qJIlMWpBtVHWxoelou2Vjg 0eYiUZnYACo66yrh5CRRxv8qoEMhGQLoFYCPFgHwvLGgFv3Ob3FC4XBu0YRVBF13Yq UC6hhB0C7S4ZAxyqiyfqUCHFtA6YvrjIJ2v/R7nSoSA5QDYwBs3tb7jhYYxl0UhUnP SBJ4OQRgDX+cnixAf2JieKiIXVw5x0ET4zcW/8RIS/vBVOyvRftc63xEYsm6q2oZiD zoLBnwhai7HtUTZWzwnbs4VYK2/E85CHCs+V17gd/HlY1C6ukXRBJZiIttasL3vXt+ pS+A+Poh5d67A== Message-ID: Subject: Re: Brace expansion in command position From: Peter Stephenson To: zsh-workers@zsh.org Date: Sat, 21 Nov 2020 17:56:35 +0000 In-Reply-To: <37c503f2-a4f5-4074-b33e-08505abaaaf7@www.fastmail.com> References: <37c503f2-a4f5-4074-b33e-08505abaaaf7@www.fastmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfMzDiKo/jRTAlu52VdEM4JLVvqgC5D0NGdb36w0Em9A/OB56bExQCCZ0uHxwkJ7u8IuodXRihfKdfGXExwxJk/r8hBdc//mDhazbcbMWhXin/nez9kZm MFNO0sHLPbGO0Fa96STB/Qc/pA5obL+979jqQtaMbohlDcgBxb0zR0dW X-Seq: 47585 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Sat, 2020-11-21 at 15:31 +0000, Daniel Shahaf wrote: > [[[ > % type pwd > pwd is a shell builtin > % {pwd,-P} > zsh: command not found: pwd,-P > % builtin {pwd,-P} > /home/daniel > ]]] > > I expected the second command to do what the third command does. "{" in command position introduces a list to be run in the current shell, not a brace expansion. So this is treated as { ... } where the ... here is the single-word command "pwd,-P" as a comma has no special meaning at this point. Actually, other shells require a space after the "{", as well as a command terminator ";" or newline before the "}", but zsh doesn't. Other shells don't need a space or terminator in the subshell form, with parentheses (...), so this is another of those minefields it's quite hard to pronounce definitely on. (This may not stop other people trying, excuse me if I don't take the bait :-).) pws