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 50BEC23D59 for ; Fri, 26 Jan 2024 05:19:11 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1706242751; b=P07Bt++nwyTMUNZnYS1kJxtoGYQKb4FSxS/76GCXqKiIg5hr1rzNt5rvkz0Fhy1fwzYHluhO5p 7MOutFr+VaboeI/mZEyUA1o+mN5F9vNA9ugZwQfSdhPsmvvH1ezZXrZ9HJVgrL88mjC8+qG1Ak Ipwl5bC2moYCgru2l0mN1eTJg026VNomMaEb0kAqsb2mJyU4Wct16rBjpIFIUxinflGwONVnXR G7cQxiuY9ogZc23XwmDALfL5GUY1ShyZL+F0JN6KF/ydImWlT5PkgD3srDwGsyM8xOmxlZ7LoU P96Od1hRPJdeytIsensAW2W2ISFFvgqzL4dPpN5j/rByxA==; 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=1706242751; bh=uYojDlAeBZp3lq8KTAwvCozwT7y9FhcWlvUC7vuJJ7s=; 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=m3hEqp3P5KP3GEdHofxJ2utNEOJFE9N1r8Hxl1D67SkmVHepWEXIVyRffHdACksxhmD5izEdVL 43GD42MP1CpSt99XnsqwcNPg1mZIQ5gAshyz3h5J/+mbvkQjKv9mlk+BRZvYpxkQuYPVCheSKf C3awEtAddnklh/62SPmCyTrC/ntJGG2Sve+42mEx7rOgI5GEAlhzN7cDKUte+1PkYQsK4IDuuh simvgLFrvlR4CYpD9os/YjdrGCYzsjeQ8Na2yU5++u0cJJbyE+1C9g39NS7Gz7OUKjaiy1yHmW u4hlDPBtC875QsrPIxI4pX5awDrx2uyiHGI331YjTZVzsA==; 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=vzb1GsoEUF/6g1JwkoaKqi0oyPWChhL8Wp7ymhnPN6w=; b=KmsY8QHBHPt3PQdVA9eOoO36Nj 8FEE7D/xyhAomHj4jpLYXlcKfCRNcK0VBOlNz+BlZMEszMeIkswdRluK94e57m+SuSKgi/VM+4io1 bqhXC86IYpH/uAahBDTOPezTMHGFQYvnL16aplZAuQJXk+YpOuT/7E/IEhi9xdb6GYNnbWFfPIPif kL+J4/dbUNLXhnznCJjSHsuV+8+FawbVUvrNAPGYkffuBnRVR4xAHIKODH+Z8b+IldmvRXR5RnChL vn6d+Ik1GEzi7jVCKvoIzm9RyZKgYyF9+VqBOzHNXP3ABEaWphNN7JAQdu7xFc+HOlaH1RrzY06E5 PNYZP0jg==; Received: by zero.zsh.org with local id 1rTDgN-000B4R-Eq; Fri, 26 Jan 2024 04:19:11 +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]:48656) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rTDem-000AJ0-Lu; Fri, 26 Jan 2024 04:17:33 +0000 Received: from smtpclient.apple (unknown [216.193.141.189]) by email.dondley.com (Postfix) with ESMTPSA id 0F22920179; Thu, 25 Jan 2024 23:17:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dondley.com; s=default; t=1706242651; bh=uYojDlAeBZp3lq8KTAwvCozwT7y9FhcWlvUC7vuJJ7s=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=ff+5U+w6NIDuXuWAYluBG70/ANdBhrggsFS+ah4DdmGskqnNIhuPLa85A4vaTCP/Y bADy+xOOUaZIL0nJjoT2yr1zaImKXccXw5+1r/gZIMXe1NElWM1GNxNlgV3/KUndUs bHEU5JIvAODibyaNwWNViEPhWFmQmAViwi7fpm3c72CovXSMxZwDeKT8QvsQXM0Aqd GmTggLaWGB6SBs6C05CM8Ow3LAfUgCgxXlZEisgXEpLV0PcW8CgzRaPBhBq9WYBbDA +sWnwdA59ZVJTKA8ioKMj9pl6kso009AMfOKOupsk9nx9VpuLHrhOWD4G1qgqKM47J RlEHWHafawUbw== From: Steve Dondley Message-Id: <3DC872AC-5B19-468D-85D5-5D3A501EF7E9@dondley.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_920311E5-C812-4FE6-AA1D-8C467890FE92" 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 23:17:20 -0500 In-Reply-To: <4a1df20e-70c4-41ed-b370-4fbbae0619b9@app.fastmail.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> <4a1df20e-70c4-41ed-b370-4fbbae0619b9@app.fastmail.com> X-Mailer: Apple Mail (2.3774.400.31) X-Seq: 29569 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=_920311E5-C812-4FE6-AA1D-8C467890FE92 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I guess I never realized that, when it comes to options, there is a = difference between running a script directly and passing it as an = argument to zsh.=20 But even still, If I do this: > echo $PATH /usr/bin:./dir > ls dir -rwxr--r-- 1 root root 9 Jan 26 03:26 foo.zsh > setopt pathscript > zsh foo.zsh zsh: can't open input file: foo.zsh > unsetopt pathscript > zsh foo.zsh zsh: can't open input file: foo.zsh So I=E2=80=99m still seeing no difference between execution of the = script with path script on or off in these cases. HOWEVER, I discovered if I put this in my .zshrc: setopt pathscript and do: > zsh -i foo.zsh It works. Or, if I do > setopt pathscript and then do > zsh -c foo.zsh This also works. > zsh -i foo.zsh wil also work in this case, too.=20 > On Jan 25, 2024, at 10:45=E2=80=AFPM, Lawrence Vel=C3=A1zquez = wrote: >=20 > On Thu, Jan 25, 2024, at 10:21 PM, Steve Dondley wrote: >> Sorry, I=E2=80=99ve got a bad misconcepiton somewhere. I stil don=E2=80= =99t 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 > You doing something completely different from what I described and > demonstrated. PATH_SCRIPT *only* affects how zsh behaves when you > invoke it to run a script (e.g., ''zsh script_name''). It does not > affect PATH searches performed as part of command execution. >=20 > --=20 > vq --Apple-Mail=_920311E5-C812-4FE6-AA1D-8C467890FE92 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
I = guess I never realized that, when it comes to options, there is a = difference between running a script directly and passing it as an = argument to zsh. 

But even still, If I do this:

> echo $PATH
/usr/bin:./dir

> ls dir
-rwxr--r-- 1 = root root 9 Jan 26 03:26 foo.zsh

> setopt pathscript

> zsh foo.zsh
zsh: can't = open input file: foo.zsh

> unsetopt pathscript

> zsh foo.zsh
zsh: can't open input file: = foo.zsh


So I=E2=80=99m still seeing no = difference between execution of the script with path script on or off in = these cases.

HOWEVER, I discovered if I put = this in my .zshrc:

setopt pathscript

and do:

> zsh -i foo.zsh

It works.


Or, if I do

> setopt pathscript

and then do

> zsh -c foo.zsh

This also works.

> zsh -i foo.zsh wil also work in this case, = too. 




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

On Thu, Jan 25, 2024, at = 10:21 PM, Steve Dondley wrote:
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. 

You doing something = completely different from what I described and
demonstrated. =  PATH_SCRIPT *only* affects how zsh behaves when you
invoke it to run a = script (e.g., ''zsh script_name'').  It does not
affect PATH searches = performed as part of command execution.

-- 
vq

= --Apple-Mail=_920311E5-C812-4FE6-AA1D-8C467890FE92--