Zsh Mailing List Archive
Messages sorted by:
Re: zsh precommand modifiers stop accepting argument if quoted
- X-seq: zsh-workers 40920
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: zsh precommand modifiers stop accepting argument if quoted
- Date: Thu, 30 Mar 2017 15:42:23 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=L7h/zgn/wqr8kP8fySY5t/UTs0psSlUSZCXCe8+SjFU=; b=CkNllnfIRXHaeRzbkk2tKoUcOPW3jUa3qKpvoY9Uxo3ybef+NIAcNF4APFBLrygSsm Bf9jtLcIppzjDUpO/SD2N5K5KwbwRTCYO1eenz2TQgHqxBEiflO8RcQ7mPCDzmVZHskz R9W8psY7P6KmaOz+Wf7VMBY70EmBngERHZWMoeeVtrA086eNTCvZC3yN+Ed/QG0asyuq ZO1JUvcFodwISGJbPSbQ4DDwZBHIt/Ed5H6BdhL7iOaWQ9sVXss/vn54i6vcBzb54M2i Y3WawapbO29TSs28i/og8Bx1T/KizE6FcKq9kB793uiJES8dYeLJ2fcMWBhfM6sF6GO6 gEPQ==
- In-reply-to: <CALS7p_d_dgpSFdibfaTB2nKHn0oSi3DHPbyD13So=UCTsaKa2Q@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CALS7p_d_dgpSFdibfaTB2nKHn0oSi3DHPbyD13So=UCTsaKa2Q@mail.gmail.com>
On Wed, Mar 29, 2017 at 11:00 PM, Cuong Manh Le
> $ zsh -c '\exec -a foo zsh -c "print -- \$0"'
> zsh:1: command not found: -a
> $ zsh -c '\command -v ls'
> zsh:1: command not found: -v
> Is this behavior a feature or a bug? it it documented somewhere?
There's no promise that precommand modifiers will work at all when
quoted. They're syntactic tokens, so if you quote them they become
different tokens. It just happens that "exec" and "command" are both
implemented as builtins, so the quoted forms can still be looked up
and run that way, but if you have changed the token then the
corresponding syntax rules do not apply.
This is similar to the way that "typeset" as a reserved word differs
from "typeset" as a builtin command. The typeset dichotomy was
introduced a lot more recently and so is more carefully documented --
there's probably a doc clarification that could be made for the
Messages sorted by: