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=-2.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28791 invoked from network); 24 Aug 2020 20:00:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Aug 2020 20:00:13 -0000 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: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=xBDi5L4UAlvjGLb6KxPSc1ZE+BAjw4AR+t3Ntf0ycsU=; b=s+qo4HUiXeySmslywRI10DkD9q Ak6I6J3XwA4LtDU76MSjMKoSk0AGsyVVHRH9b5TvyHr6Yi9HQqkbIehEzvB7zBvZQlDyTcfSd3T0o eXjBaJKBnuiLGinvQfMvdolpkJOGa3L4EAGrnBiS1E0mIld2ZyvYYeYVpP4kxvwJbz/IFdSb8rcOD 0Hi7F1yWurMBTVQcXbheZpUTqGnMWnk+CBvqfO5FlSoRcUezM36r0y23AVU518otbnl2OCQiWuBRx RLVeWhgBS+M6hqbCEpkUTJMoC19RHftLyb9EpZmxFIRFV+gGHB4o9ZT2kXoT7Vlo4Ni0LnL4LXp5E xuSSpz/Q==; Received: from authenticated user by zero.zsh.org with local id 1kAIdY-000Occ-UK; Mon, 24 Aug 2020 20:00:12 +0000 Authentication-Results: zsh.org; iprev=pass (freekahlil.inlv.org) smtp.remote-ip=46.19.33.18; dmarc=skipped; arc=none Received: from freekahlil.inlv.org ([46.19.33.18]:41858) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kAIdG-000OS0-EC; Mon, 24 Aug 2020 19:59:54 +0000 Received: from [192.168.1.250] (host86-142-63-153.range86-142.btcentralplus.com [86.142.63.153]) (authenticated bits=0) by freekahlil.inlv.org (8.15.2/8.15.2) with ESMTPSA id 07OJxqW6005566 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Mon, 24 Aug 2020 21:59:53 +0200 (CEST) (envelope-from martijn@inlv.org) Subject: Re: command -p should enable builtins not in path 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> From: Martijn Dekker Message-ID: <99d03601-babc-14c7-21b5-41a7a8c90eab@inlv.org> Date: Mon, 24 Aug 2020 20:59:52 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200824183010.GA1728404@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Seq: 47337 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: 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) 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. - Martijn [*] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01 -- || modernish -- harness the shell || https://github.com/modernish/modernish || || KornShell lives! || https://github.com/ksh93/ksh