From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17566 invoked by alias); 31 Mar 2017 00:51:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40921 Received: (qmail 8556 invoked from network); 31 Mar 2017 00:51:02 -0000 X-Qmail-Scanner-Diagnostics: from mail-pg0-f48.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.83.48):SA:0(-2.3/5.0):. Processed in 1.673682 secs); 31 Mar 2017 00:51:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: cuong.manhle.vn@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.83.48 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=c/eRB6e2RsBNCStnNHTyhf8YypsDknpwICbxirNciBs=; b=DuT/6kwtBn/jSMuSb1qjBPDjmW3dzc00jrNRSmrClk7wN53Z2csD2Cu/jcBuk00CB0 0MmSjVBl4BEL5ZsrXJOfFzIx4GhlVmX2Ouadip40Dth6qA3BHb8bp5TxPr5kcvgkjUNW XuSZP+S+B4CcxMAOU+CaY9htmiFyeCMxZKzAEvSG+PhR5MNgGuxMbOQ77F6j9u/Tsvdc RsNjC/BBxi9SoNxf4a+UBuzssn3u2PScKwbWcB4C6UhNVKcxMXvcXXxwnx+bNT2Iq/6j 5aY+AhaWVyuWixjtSekkg6NvJID2ww8aPjija+ZJHkO61aBnXo/Ywo1Z0gkWn/MikBYX YaYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=c/eRB6e2RsBNCStnNHTyhf8YypsDknpwICbxirNciBs=; b=s0+I9LgIJVNPGMTzvxygvT0ygGvXqUya3PCuWzJ6ccpXIcaPn/N1Airb1VuvAhw/t6 xg1y2wg0oV3DXiAZssJGzKqLaxRk6Z8fInh6kfNw/nTw7Uuv/z/EBjJGnNx/OCkqqiTq wY0lxvI/Fxx9clqSKvvggTSY/kjMeEmZdHwCDaI0sWai6Ez3uk3VcuT+Z9i6no6erYua YAn/0JBKlctgy2t4/sJjwHZL4ipBBnrJgCJpcYTF2pjJsgmFnQVONHEfWsANUGN9HRCH ikQwS0nsKurcsvhjKWmQmednWh8OdL6ulzzVX3Ol/t+BcJt6d50YHGBaP6kY9cIqT4sY 8FJA== X-Gm-Message-State: AFeK/H2qDEqJeUyXWackCuIiGdONhhKAyJS2I7BlT/T0EHL+WylNaPjKbQVrcCpfiaVc62cj3OkFJ9wwgqGf8Q== X-Received: by 10.98.102.88 with SMTP id a85mr192557pfc.33.1490921457026; Thu, 30 Mar 2017 17:50:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Cuong Manh Le Date: Fri, 31 Mar 2017 07:50:16 +0700 Message-ID: Subject: Re: zsh precommand modifiers stop accepting argument if quoted To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/alternative; boundary=001a113e3efcd58c3d054bfc3315 --001a113e3efcd58c3d054bfc3315 Content-Type: text/plain; charset=UTF-8 So there no way to prevent an alias named "command" to expand without breaking the script? In other Bourne-like shell, once can do: \builtin command -v ls but it's just broken in zsh. It doesn't work even in sh, ksh emulation, so making zsh non-compliant there. >>From user perspective, it's definitely a bug. Cuong Manh Le https://cuonglm.xyz On Fri, Mar 31, 2017 at 5:42 AM, Bart Schaefer wrote: > On Wed, Mar 29, 2017 at 11:00 PM, Cuong Manh Le > wrote: > > > > $ 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 > precommand modifiers. > --001a113e3efcd58c3d054bfc3315--