From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16970 invoked by alias); 26 Jul 2017 17:46:14 -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: 41468 Received: (qmail 21640 invoked from network); 26 Jul 2017 17:46:14 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f182.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(209.85.216.182):SA:0(-0.2/5.0):. Processed in 0.956913 secs); 26 Jul 2017 17:46:14 -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=-0.2 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.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 209.85.216.182 as permitted sender) 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 :cc; bh=JOptB3g0Ytb4i+m9UvJtUAu3WKWfOOnvOHQsTJMWNSI=; b=JqV955JQDg6o0LUSv+lPnoyKO1LYpMAooFiyunSAgKXa1ewZfIbA8ArjDmJnLcuNup DFuBwn0znLE0N5anjVlx4fgk417xlKXzz+GT3qAERXiChxDoqF/0oLGnGp5giFN/48SY tOhJqs5Pf038a12CGByFn+MfvpvYAl2O9EDl85I3/Lg0ykCj4wfjtpXFICrh6jFLSp/Q Phl35rkQgmfnAmXEyfDstqFOBFY8yeTEpq0zzCAM0bGwNCPFNd9r3wZknTznhctYTQS3 T4cpy4RP0Am9/RXYY3rAvi5UEvxz9h04MT4+TMJHpnFdst8DD2bNA5bTcWQ+zPB1iNsf Dt4A== 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=JOptB3g0Ytb4i+m9UvJtUAu3WKWfOOnvOHQsTJMWNSI=; b=dqnzEoRjHldSWcoRkh+PA60YAQhZgGBT262qRa+JyH9CmW/DcroG30S5opToXRpYhY J0k+tnMEWYkxdMhD3mynUtQ4LDFboQR54Sc0nf5lzYRlpjNjdYwkpfyy44fX4PHswH/n 35iwdWGUPMit6vAEw/CNoiQNnNPUuR52DwEbcddaJ0aVBZhLa44hih+4szDmwlvl1uAE /S2DQ08jpmbJ5KRbq9p5RWOcZXB+fQm5uRCln5Rm2j30CkMwXVRgH00ADZd7pRofcvSH HrCJPXKT3yRtiUlK/Gq3E97rBAqnhCuIYSmFd8OFyGRr56sWuu14ZA6k9ihLv+qw9Yhz Yu3w== X-Gm-Message-State: AIVw111FMmU17Bt6YF8uiHCdwfOeb8v/1rb0t3LST9jRz8geLMOufMfJ rAIn0gU5Dm4+lqdlcuFr2yYoOjRPYmsz X-Received: by 10.200.55.147 with SMTP id d19mr2352781qtc.94.1501091167430; Wed, 26 Jul 2017 10:46:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Bart Schaefer Date: Wed, 26 Jul 2017 10:46:06 -0700 Message-ID: Subject: Re: [BUG] 'exec' runs shell functions and builtins To: Martijn Dekker Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" AFAIK zsh has always had this behavior. It also allows for example "exec builtin echo" as well as "builtin exec echo" etc. What would POSIX say that exec command echo foo should do? It's relatively easy to stop "exec" from finding functions and builtin commands, but I think fairly painful to get it to ignore other "precommand modifier" tokens. Even after PWS's 41464 the above example runs /bin/echo whereas I think the POSIX expectation would be to report "command: command not found". > This behaviour also appears to be contrary to the documentation in > zshbuiltins(1) ("Replace the current shell with an external command > rather than forking"). The documentation under "precommand modifiers" (which is cross-referenced from zshbuiltins) says: The following command together with any arguments is run in place of the current process, rather than as a sub-process. The shell does not fork and is replaced. I think this is a case of the zshbuiltins doc being ancient and imprecise rather than intentionally indicative of anything, but: