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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6529 invoked from network); 2 Oct 2020 13:18:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Oct 2020 13:18:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601644695; b=NUUQAJ4wuJfkdKeHmzLa2f476NdEBuBxsteFppqVPxW9LLvrUONK+yN7pbCTQ8UM5TZ8pEzvxk DYNWBrTb8nhtQBSK/+PCxHeDZ7EW4f9wjFDldXA1yeoFUvG+P82KUYLMJ0f1bJbZD7J3XFd0N3 +OZsIMpq06o87MAzGeDYBTy9FXcRIyjUiejoOnK8WwD1kuaUnqEPHdaCEpbkAs6kre0eovjz0X XkJOVH1m293haL7t4RV+M1OtKHUMUNtLdhMIk58yDOLLjXNhHOXcgEbeMWP4HzFghJvVsdTQ9K fHyH8RoWa1FuXflG2Xj+sHFUv2/+MmH2389D5w084JMXpQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1601644695; bh=k5toIkBWkauDzgkfu86NY3tbKt7CvDSwOzLgSo37ARg=; 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:To:From:Date:DKIM-Signature; b=RftDApDeMC01hnPkhcDVxgW1whKk+MBHXMvyw99KcpUhYJHoI+nCPJ4hU/mX3wzbdwkMJaO/Qu n1zqw6e+PJsGVTSkfJSIb7dPoY5GeFyTlmhsoakhw8loJ5ejiPG3ONwbZ/b6hZh6J63IA2U1t9 mW2UiYVkX1qjUujmgUpU9m9O/dDUoP6oGTUp3BgX59iCDjoZzOq/0zqV9pHLjlU0k6Z2yEyL69 0KmPCxlmxFsNxJSqb/AzLP7exDNRcBvgFnoBQXJe+ugAGtlv58+wW8RrHCj00u5l6/MhlmdWfN znk4wGrAJbKPptUePUWAepx6BW5PiClexx44p6oLHzzh8g==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=AtL2wJb5xaRs00auYUkuxLWQH6haFr2ZnuAPI1oSEHs=; b=n1IR7htelbxQOlULVMlAikm1A7 6bVBtmFio8Z0dtQyjJA1haLgkiDKjSoS2iGdt166Yk/eliijfphPrc6Vt7OYg2fENgEDpCGGGJ6YU IIxLstXklW1lqGO2JACvTmHV/4aUx9R5dUII2CLSMJKxWeQ7vGXYmBpGkT9/nZTu9OG5aZ1Gc1oAq JxHWM+TUx+oca7zt5AIR4eGn6ijJEYmEO1JrZOIMJyx6orjM4+e/0Ypq9jku1dwHs8hdLXnuSuvoJ MCQIsoW4hh5KM6IpQRIMUToBTyGxNdv4RRVvuEYMI0LX+29wYddw5RO9P3woSdQQwgrpSAQC0iBye u1FcKrZQ==; Received: from authenticated user by zero.zsh.org with local id 1kOKws-000NRx-QQ; Fri, 02 Oct 2020 13:18:10 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:43118) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kOKwc-000NIG-Rn; Fri, 02 Oct 2020 13:17:56 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 7498F69; Fri, 2 Oct 2020 15:17:53 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 37757C251A2; Fri, 2 Oct 2020 15:17:53 +0200 (CEST) Date: Fri, 2 Oct 2020 15:17:53 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: command -p should enable builtins not in path Message-ID: <20201002131753.GA154103@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20200820112815.GA216072@zira.vinc17.org> <1194318329.1319677.1598015007835@mail2.virginmedia.com> <861d1eee-a00b-f90d-21f3-7129afa4d765@inlv.org> <20200824183010.GA1728404@zira.vinc17.org> <99d03601-babc-14c7-21b5-41a7a8c90eab@inlv.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <99d03601-babc-14c7-21b5-41a7a8c90eab@inlv.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.14.5+76 (bb407ec3) vl-127292 (2020-06-24) X-Seq: 47419 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 2020-08-24 20:59:52 +0100, Martijn Dekker wrote: > Op 24-08-20 om 19:30 schreef Vincent Lefevre: > > However, "command cd" is not guaranteed to work in a POSIX shell, > > e.g. if $PATH has changed. > > That's actually not true, 'cd' is intrinsically a built-in utility (it > couldn't possibly function otherwise, as it must affect the current > environment) Well, AFAIK, some OS's provide a way for processes to affect the environment of their parent. So an implementation could theoretically choose to provide cd as an external utility. > and it is also explicitly exempt from a $PATH search by XCU > 2.9.1.4(d)[*] (not that most shells follow that absurd $PATH search > rule for builtins anyway, but that's a different rant). Point being, > POSIXly, 'command cd' is safe. OK, I agree. So, shouldn't this be changed to match the POSIX behavior for the utility list from "Command Search and Execution"? https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01 I'm wondering whether any zsh user relies on an external program for such utilities. Or, if there is any issue with such a change, add another option, similar to POSIX_BUILTINS, but restricted to this list. FYI, I've just found that the "command -p" was added in Intel's scripts because of a bug report from a user who defined a function named cd: https://posts663.rssing.com/chan-20519098/all_p8.html ("command" would have been sufficient as you said, but there would be the same problem in zsh). -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)