From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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, DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 04B5628988 for ; Fri, 26 Jan 2024 04:25:12 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1706239512; b=RUjtZye7mKy9R6DOkzEUvKPQqR/KRouPjD93pxUTKT4Nel3cMPzENHOvf93i5YhHpIYXHZ5Iq6 e5Lo/+yTX1rad8OlGjLLz2WjiDT6KhW7PgUhWPpbMJiKsLU47yy2fxSJcXSySMP4zdgOfTt84r rGzYgCFY/2t7VzTwvgMUTsNGOJVhIg/aS4SdSV9moDNGTwNzZps3OVXZViwoWMoElco7qlyqWt Z4xHQ78TaYSBxjbJ1msKGrxMxbat5rtGa1hIXkqFiVpmIaFe+hEWVKO6OxlkeLdsdAuFn+RZ+d p9lGaKGe/IsBENX/qP4BH2QQpAZKXag4GI4h14siTNZXkg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (email.dondley.com) smtp.remote-ip=34.203.132.18; dkim=pass header.d=dondley.com header.s=default header.a=rsa-sha256; dmarc=pass header.from=dondley.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1706239512; bh=JbobyiffBRUgvcFrXcWTO7Ipn2UYOM5C4/gscshTINQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:References:To:Cc:In-Reply-To:Date:Subject:MIME-Version: Content-Type:Message-ID:From:DKIM-Signature:DKIM-Signature; b=KEKNvOlvUvKIO0Wi6bQtrCieP/Kufo3NXBDmuwkktu96qR+27O1gA7RJySN50Nq4Z947DDrJrO DsYHdFbWIjEANt9EZBYBuZBe7cGtHBNP+EGVoNcuO/c+rEtT+YEX+oW+TlrCUvyw9DJplZe7LX TFthupZrN05MZcbSeCrMNA/AkYc0EfN/EMlrDPYvIOuhmkVRF3CFQH6Skm/bQ4/2CW6isJUvBR BpUahV6raGtt6h8fj20DzPGwMWJSIjxHOxFz2fhc3eemvpEw40sn3f0DSrGL9m4EJYN3s0uEHM ZTJvXLrRl5DZEcrvWN5ovNyV7b79Pd8DKublt6oFD3pbHQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:References:To:Cc:In-Reply-To:Date: Subject:Mime-Version:Content-Type:Message-Id:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=3gD1tulC710taX3etdi7h3BQ2SPJqEngCXpjAQUXf20=; b=AMSggj9xeherDlZjz8hOBHjopm 24RP7+5UM9ySzkPJxrk1Uoci9EpBf2p0ZqMBOKjyO2sNyQHgOu7h7q3H30hDhO2Z69Icw2nbeA64C TjH6tkIjC1yoLc+9PIOeXvfuNgpNJzpjcDBl4WEuDTuNkcwvBFjkgBIa3SVHMVfeafeMk5DneQ8Fb S057O13VN6AY5wglAbPQ1QalOdd6sfrOwJx3h6x5myQzCZjQ70JvfVQKHC0KtYJuFltaa7lO1lQBx LYQmayKwI1Hq0Ty1wfcLFfiCceCkQUkaaIZegblP7XbbJlxT4GLPISH6gG3iwUQXCMC3AbAoYmdVz sgwWn3bw==; Received: by zero.zsh.org with local id 1rTCq8-0005RH-B8; Fri, 26 Jan 2024 03:25:12 +0000 Authentication-Results: zsh.org; iprev=pass (email.dondley.com) smtp.remote-ip=34.203.132.18; dkim=pass header.d=dondley.com header.s=default header.a=rsa-sha256; dmarc=pass header.from=dondley.com; arc=none Received: from email.dondley.com ([34.203.132.18]:43286) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rTCmy-0004bV-Km; Fri, 26 Jan 2024 03:21:58 +0000 Received: from smtpclient.apple (unknown [216.193.141.189]) by email.dondley.com (Postfix) with ESMTPSA id DECB92018C; Thu, 25 Jan 2024 22:21:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dondley.com; s=default; t=1706239314; bh=JbobyiffBRUgvcFrXcWTO7Ipn2UYOM5C4/gscshTINQ=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=G0RhvHuM7yMWiU/mm32xAtmo+DNI0RK/CrArLTn+IoZapKkIoKyQZJRwpUQGhke/b 2KUVCO78S3YIneOugmjd10CwWzVzy8UhD3E4pyoAUZ36B9uMrb/dskZcseR38E/VIK xq8Eb8mswIPHBECCgD8JkbI0+COkWyyVyPqHUVbvUw6JrsD0mCuDdIwgH+4rVwpmHe CoGDvOIbTf9Pt42nigMF623TXyH7X8OY1lgzvq61VbYlFu3Clqmc+5Ak9tgiGr+X29 7pOVcxSGbeJjnQq8oJm+zeCyiK420y7Klk2/MSgbXzSZF2k7+QSU4Bh5WiHz4HBYWG bAo4AgbUShHDQ== From: Steve Dondley Message-Id: <680FA5D3-E8FD-49F2-9AE3-C169A6D9DA9E@dondley.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_B3213E13-56E7-4B30-85E5-7FCFEDF71E72" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Re: Can't tell the difference in operation between PATH_SCRIPT and NO_PATH_SCRIPT Date: Thu, 25 Jan 2024 22:21:44 -0500 In-Reply-To: Cc: zsh-users@zsh.org To: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= References: <73E4333B-C282-4A58-837C-A50F73E13289@dondley.com> X-Mailer: Apple Mail (2.3774.400.31) X-Seq: 29566 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --Apple-Mail=_B3213E13-56E7-4B30-85E5-7FCFEDF71E72 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Sorry, I=E2=80=99ve got a bad misconcepiton somewhere. I stil don=E2=80=99= t get it. I do: PATH=3D.dir When I do: setopt pathscript And then do: foo.zsh It finds foo in the ./dir directory and executes it. Then when i do: unsetopt pathscript And then I do: foo.zsh It stil finds foo.zsh in the ./dir directory. So I=E2=80=99m not seeing how it behaves any differently.=20 > On Jan 25, 2024, at 10:05=E2=80=AFPM, Lawrence Vel=C3=A1zquez = wrote: >=20 > On Thu, Jan 25, 2024, at 9:00 PM, Steve Dondley wrote: >> I=E2=80=99ve been looking over the documentation and I really can=E2=80= =99t make sense=20 >> out of what the PATH_SCRIPT option is supposed to do. >>=20 >> If it=E2=80=99s set, which it is by default, I think it=E2=80=99s = supposed to look=20 >> through directories PATH and try to find the command. But if it=E2=80=99= s not=20 >> set, it doesn=E2=80=99t look through directories in PATH. >>=20 >> At least that=E2=80=99s my understanding. But as a far as I can tell, = I can run=20 >> a command in /bin with or without PATH_SCRIPT option set. >>=20 >> I=E2=80=99m obviously confused about what the docs are saying. Can = someone shed=20 >> light on this for me? >=20 > The option affects how zsh behaves when invoked without -c or -s > and with a first non-option argument that doesn't contain any > slashes. In this situation, shells generally try to find and run > a script with that name in the current directory; if there is no > such script, they try to find one in PATH. PATH_SCRIPT lets you > control whether zsh performs that fallback PATH search. (It does > not affect other PATH searches.) >=20 > % cat foo.zsh > cat: foo.zsh: No such file or directory > % cat dir/foo.zsh > print foo > % PATH=3D./dir > % /bin/zsh -o PATH_SCRIPT foo.zsh > foo > % /bin/zsh +o PATH_SCRIPT foo.zsh > /bin/zsh: can't open input file: foo.zsh >=20 > --=20 > vq --Apple-Mail=_B3213E13-56E7-4B30-85E5-7FCFEDF71E72 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Sorry, I=E2=80=99ve got a bad misconcepiton = somewhere. I stil don=E2=80=99t get it.

I = do: PATH=3D.dir

When I do: setopt pathscript
And then do: = foo.zsh

It finds foo in the ./dir directory and executes = it.


Then when i do: unsetopt pathscript
And then I do: foo.zsh

It = stil finds foo.zsh in the ./dir directory.

So = I=E2=80=99m not seeing how it behaves any differently. 





On Jan 25, 2024, at 10:05=E2=80=AF= PM, Lawrence Vel=C3=A1zquez <larryv@zsh.org> wrote:

On Thu, Jan 25, 2024, at = 9:00 PM, Steve Dondley wrote:
I=E2=80=99ve = been looking over the documentation and I really can=E2=80=99t make = sense
out of what the PATH_SCRIPT option is supposed to = do.

If it=E2=80=99s set, which it is by default, I think it=E2=80=99= s supposed to look
through directories PATH and try to find the = command. But if it=E2=80=99s not
set, it doesn=E2=80=99t look = through directories in PATH.

At least that=E2=80=99s my = understanding. But as a far as I can tell, I can run
a command in = /bin with or without PATH_SCRIPT option set.

I=E2=80=99m = obviously confused about what the docs are saying. Can someone shed =
light on this for me?

The option affects how zsh = behaves when invoked without -c or -s
and with a first non-option = argument that doesn't contain any
slashes.  In this situation, = shells generally try to find and run
a script with that name in the = current directory; if there is no
such script, they try to find one = in PATH.  PATH_SCRIPT lets you
control whether zsh performs that = fallback PATH search.  (It does
not affect other PATH = searches.)

% cat foo.zsh
cat: = foo.zsh: No such file or directory
% cat dir/foo.zsh
print = foo
= % PATH=3D./dir
% /bin/zsh -o PATH_SCRIPT = foo.zsh
= foo
= % /bin/zsh +o PATH_SCRIPT foo.zsh
/bin/zsh: can't open input file: = foo.zsh

-- =
vq

= --Apple-Mail=_B3213E13-56E7-4B30-85E5-7FCFEDF71E72--