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 D76FD23F0D for ; Fri, 26 Jan 2024 04:34:03 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1706240043; b=QDnRZsrYolovqtW2xJh7mRFUifJZBVp6skSupXr2ZzBLw0OcMBDvz7AZfYYeRUKFX2+nX/C2z0 L3q43ixlO1DPT/8Xozb8IyL0BnWCfJe0BM1+VA70j4Kzs0zJgPIG0D2WFWe/OR8wkhU/5wfP0N XfKRolwBK9g846R5vWjeAFdp7HfX3+1wdADrD1+8NPanPcX9OWmYjiqy15DiWag3jcHBmZZJy9 Ih0rCpFTvCeDfteL10p+i29+A4D0zJ7WmyOfhXX9meKiTki6ODWrd1V1cIWFGWtvlg9kDFtdOf jhTdwapb5sO7A1pSmJ+plD7XuGZPz9LqfEVmMap2doNzdg==; 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=1706240043; bh=On5WykbwGMH9kcFXRnjEjkQuhhyIy+06WyU5Wt9vVL0=; 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=XyuZD5fzvP87WxZql2PtJlYm3rKqEM/fR7ORg6KH/6uHCg4rUFu793jlL8cOFthPwje5tUZwi3 nJ1iDmLHUuqf419FfiBAombiMMv6+H2Ac+0QIxhyU+/89AVQqsyna4TM4BUyiLLpx6WR2Ro5cp H3A4U+H07IJlF9vXOtBwN5YFMxpJD0VuPbxbyR522HUHE7oQ2kVV3FelxsqIHhOzjZZa1Iztdw YGaEIrwAgvTgBCsplcQD4Z32HFn0hQPNs99Nf9m6HaLYNDNt6RgI3zmjMMpv0xzdgZKNTQkyyJ TyT5FB/YkL7ZjHHiY5nyxLatasHYW3LfJb0cKnjZ3heWHw==; 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=fKDDSqZG42Htb4ViPSy88PZx//1F8JAn7o40QIXpsLs=; b=BBSecGFpo9qk3fczMF49q+196w 3ieFZ1IyUHIdNoipnwW9q0oc6ArKgy7PlLZ3YWWGXNAJG76tGilQjBNPSJKqTjAntYl43V+eBbhBC pJ3Y1w5Roa0fuFYIHbjqhTPBIM2A6zVIgsMunjCCmJ957noGYn+tDUAgDxxOi0qsx8ezPhDDAhFkO JIZljKwWC6oRCgtcVqoOGGPGXsnmwGDwDketnyXATXpnycIaG1SZzejFX2UOkIxjeL0pf6Uz03tFv FmiZTZy/HyI6kCD/lIZvuR4L3FK3qb5Wx9U5Ps6TX8H5c9AAJQ8HCXcyXtvbMd60ZZOSUa8f6ZHDa zSvRe2wQ==; Received: by zero.zsh.org with local id 1rTCyh-0006uO-5N; Fri, 26 Jan 2024 03:34:03 +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]:46802) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rTCvZ-00064d-F5; Fri, 26 Jan 2024 03:30:50 +0000 Received: from smtpclient.apple (unknown [216.193.141.189]) by email.dondley.com (Postfix) with ESMTPSA id 12FDF2018E; Thu, 25 Jan 2024 22:30:48 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dondley.com; s=default; t=1706239848; bh=On5WykbwGMH9kcFXRnjEjkQuhhyIy+06WyU5Wt9vVL0=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=xGq8q6cr9MQmsLrnvbXr//muHrYIGkZDEQYXtUb0Gc3+SOm43vjvcknUajw7+kTho pouiZLbuNBxmdkeMvDp0mSAj/cY0ZCQJPaN8ek6ZxChpQIn1HBVyM1oAT7vLhLHA73 GJyAqmnRPl3kbJ9jvXv59gjX+jbshlt02ZLdkjgwisUoSdjN/GGw/T4cphQ/F7tQVf lujQrQq2kVHL+2IUrGWGww8o0n2MOq18YE+DZlgUTNVIgW6zCArEMpTRyGyLDqzlRm D+9DUPE5FmE6Ajr/GC/yaGdOLgbuQk4Ko1ddIYwxdaEr36xeJRr571VjwQ4nG/9LVC rh/0F7cgBkjKg== From: Steve Dondley Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_BD3CD93D-4A98-49F3-AE56-C11116771D13" 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:30:37 -0500 In-Reply-To: <680FA5D3-E8FD-49F2-9AE3-C169A6D9DA9E@dondley.com> Cc: zsh-users@zsh.org To: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= References: <73E4333B-C282-4A58-837C-A50F73E13289@dondley.com> <680FA5D3-E8FD-49F2-9AE3-C169A6D9DA9E@dondley.com> X-Mailer: Apple Mail (2.3774.400.31) X-Seq: 29567 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=_BD3CD93D-4A98-49F3-AE56-C11116771D13 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Small type in the last. That first line should read PATH=3D./dir I also put a foo.zsh in the current directory and it is never called = regardless of whether pathscript is on or off. The foo.zsh script in = ./dir is called every time.=20 Thanks, Steve Dondley Owner, Prometheus Labor Communications Westfield, MA 413-537-4451 > On Jan 25, 2024, at 10:21=E2=80=AFPM, Steve Dondley = wrote: >=20 > Sorry, I=E2=80=99ve got a bad misconcepiton somewhere. I stil don=E2=80=99= t get it. >=20 > I do: PATH=3D.dir >=20 > When I do: setopt pathscript > And then do: foo.zsh >=20 > It finds foo in the ./dir directory and executes it. >=20 >=20 > Then when i do: unsetopt pathscript > And then I do: foo.zsh >=20 > It stil finds foo.zsh in the ./dir directory. >=20 > So I=E2=80=99m not seeing how it behaves any differently.=20 >=20 >=20 >=20 >=20 >=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 >=20 --Apple-Mail=_BD3CD93D-4A98-49F3-AE56-C11116771D13 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Small type in = the last. That first line should read PATH=3D./dir

I = also put a foo.zsh in the current directory and it is never called = regardless of whether pathscript is on or off. The foo.zsh script in = ./dir is called every time. 

Thanks,
Steve Dondley
Owner, = Prometheus Labor Communications
Westfield, = MA

413-537-4451




On Jan 25, 2024, at 10:21=E2=80=AF= PM, Steve Dondley <s@dondley.com> wrote:

Sorry, I=E2=80=99= ve 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=_BD3CD93D-4A98-49F3-AE56-C11116771D13--