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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 9EDA721360 for ; Fri, 26 Jan 2024 17:08:22 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1706285302; b=lrmY0giTanhLM2nM55AhBwjfGeSgPbhvy3OVIlj8Dq8Fc9M3L4Z8aGSw5UXzujZTvg8YWFTCUE ATh+Sp2E3Noz2VEcOQKsstGC2osL1xTPZ3kTa+a5iR7YuMBhI37JynRkxvNcp2ZXRzzlmr37rr MFgCrvqjdNCcDjZmM6P4Xd7MjnhPxLa0OFRUiVtYBIHzvnyJRp/L6506SUSHGGVKKrcZAIu1Rl YYcyPgN84Xhamj0G9V//5cg96kyTrMi0qYFRZMoe52Q9LS/Yms0LfvOd+8LWQauWcwmle7gNF2 yNVnVFDu53jF1SvR3bFafu/2C74JH9q0Af+tKeaRWok37Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f172.google.com) smtp.remote-ip=209.85.208.172; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1706285302; bh=YbVaZ8AzAzO+R6vuRWsfoIHYNJphvR99xKDZSgYUY9Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=slQNQWznQoOC1rJ9fxcbXDVZ5Xo0VLMUKk5d0c11NmKDGQJBZb3KPpMPp/Pz4YdEId6VCqPdS6 weJy5oT3YCabhtv3+wuwCC90q/M/hPgCfjXHPEWAIqydritcp6N6wmaBUnCWzyasbCgJXBcA1t 374Ng7+VHJcteqxgzxriao+qn8QlWtfgWA4ObncUheAkO1sOlzZcMoeiVHobedSNN8yzxPV9ro 5FOMpvAAa4vVHSzErx+Zb/FP8nkDEAHr+5Tq5p1nHoC4c8PRBE0zIABbnPILN1G+hAIOkcwLmS Jbfvc2a6Oob7HeoyEFMPYODpg9gtkVLRFvRW9pUQt/rU2Q==; 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:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Hvve4tepVkjZ9S59KPnEiKo16TgfgapUrqqIkmdUiP8=; b=bzdlWPrrkALwty7xcmS1AWPvDa pB0B0JSrxB+gXX2isv0MOzDxC9Lt05/QZRwEwUPFxsl75kiGF0yh1XaeNEeuQsjupjF+Pv6AEY71Y rIuVnM9R9kkmxiisTL281sRRtzZ6oAPCkSpIrV1HFVw0ht+8lXOd9/Y+/2MIHnsK7PmaqDuuwPAZx YcsrgSKrrFb1XFWvAYKZZ1DfiSFMOvC6ZAh5N/kqwFlwK+UD6OMnXo9e4iN1SK9oSRABZoCo9INkw owwoMopDCa4wrslZiJPzi3825R9c9/Pk3S088FXPIlmfO1qAKdUTlL0Hbg/HJjP6l94eMFEHfaPNB atiasZcQ==; Received: by zero.zsh.org with local id 1rTOkg-000OpV-0p; Fri, 26 Jan 2024 16:08:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f172.google.com) smtp.remote-ip=209.85.208.172; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f172.google.com ([209.85.208.172]:43465) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rTOjl-000O7J-HG; Fri, 26 Jan 2024 16:07:26 +0000 Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2cf47acf8f8so7003881fa.1 for ; Fri, 26 Jan 2024 08:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706285244; x=1706890044; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Hvve4tepVkjZ9S59KPnEiKo16TgfgapUrqqIkmdUiP8=; b=C4ZyDD48z6UYOGRtmo+WfUspHdqUBLzNdv/BRTiRjaD6akFVvt6N6xZWJTs5kuGryY Jva357vF42DLElidjXZo+iPpf1dG75Nuu9g7Ml628YgZRZOm7x8pYHbpTV65D8s2/gHK L4KD3axzv08lRTILQGyo4K0H4KY91ag8EpczPHAvZwYDV1c4JG1HjhU4sJOlJdxFXeXo nKquXePr8b2hwBIqq3lX6O3iRHsQsEsnEipoyV0tt7utBBZrLhIa7XdsWKhRfp7G3gf8 aiEVbQvLS7jbgOvQHnAbM9DirLZuF/rju8g6iuqSj86ejoG1t0/K72FKDN2r1AhWMuTn Q8KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706285244; x=1706890044; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Hvve4tepVkjZ9S59KPnEiKo16TgfgapUrqqIkmdUiP8=; b=EDSGM+7TuQBRR1JCoNpBWVWeImDww03X7Jbw6V7+CVWA2XB/naz7AalIY+7X+vYwXI xH0JVff6pMoSmoyBWJ/m4+o/7Qx42WNmGup83g0juRe7nZ+j2qRPNeH9pEczwNhMtCwY UJAe7VaifrhYsPqqIes6QrcstTat9Nh6wLv+2rZeiqNlXyF4DxNVtAzSpvvywAHHDEY7 rmU0MOt/2NLApGWDyC+Wglh8PLbgmpN/1L8lrb8jpuIxdGy+thm0GixFnUNmRB70f9U0 cJ30Dqez9hBTFuGPhHI+lkEZmtj7foaqIeGMma0v5xe7gU8yEtC98dEOvLmCUvT6iqtS Bt4w== X-Gm-Message-State: AOJu0Yx4dDMSLx/Qq7Amcx3DRecAYAt++WsmWeSed0PFM1dYcd7oyubk 724pf7NsVNvX23hcitctDzqjNk4MPsgejkfcGsu+e14gFhNyKkGUeEtRs6WFMqztSKJTdLP8zwj RWIoY5J505rme72AJUEu+ahz9/ARM/plwnVE= X-Google-Smtp-Source: AGHT+IH2lN3NSeApSsi1o6Ub01Bwus15f+tSE0rCNrtdQyx1md485DeEgNd/InSe5YgyWuoU+lXSqsyJKqpwv/QgmWo= X-Received: by 2002:a05:651c:c8c:b0:2cd:1393:ac78 with SMTP id bz12-20020a05651c0c8c00b002cd1393ac78mr24117ljb.17.1706285244237; Fri, 26 Jan 2024 08:07:24 -0800 (PST) MIME-Version: 1.0 References: <73E4333B-C282-4A58-837C-A50F73E13289@dondley.com> <680FA5D3-E8FD-49F2-9AE3-C169A6D9DA9E@dondley.com> <4a1df20e-70c4-41ed-b370-4fbbae0619b9@app.fastmail.com> <3DC872AC-5B19-468D-85D5-5D3A501EF7E9@dondley.com> <2CF29A22-6721-4275-8E92-7FF61CE4CDCB@dondley.com> <316F625D-EC13-43C5-808F-B78DD09E906C@dondley.com> In-Reply-To: <316F625D-EC13-43C5-808F-B78DD09E906C@dondley.com> From: "Mark J. Reed" Date: Fri, 26 Jan 2024 11:07:11 -0500 Message-ID: Subject: Re: Can't tell the difference in operation between PATH_SCRIPT and NO_PATH_SCRIPT To: Steve Dondley Cc: Bart Schaefer , zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000de495a060fdb7db9" X-Seq: 29579 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: --000000000000de495a060fdb7db9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When you set an option with *setopt*, that sets it for the shell you are already in and typing commands to. When you run */bin/zsh* as a command, you are starting up a brand new shell that does not inherit those options. *zsh% setopt pathscript * *zsh% set -o | grep pathscript * *pathscript on* *zsh% zsh -c 'set -o | grep pathscript'* *pathscript off* So doing *setopt pathscript* has no effect whatsoever on what a subsequent */bin/zsh some_script* will do. You have to do this instead: */bin/zsh -o pathscript some_script* On Fri, Jan 26, 2024 at 10:50=E2=80=AFAM Steve Dondley wrot= e: > > > You have this almost correct. Sourcing for interactive mode has > nothing to do with it. It always applies to the scriptname argument > passed to a new zsh, so it has to be in effect before zsh searches for > the script. > > > I may not be following you here. > > If I have a script at ./dir/some_script and I do: > > > PATH=3D./dir > > setopt pathscript > > Then do > > > /bin/zsh some_script > > It will not look for the script in $PATH as far as I can tell and fails > with zsh: can't open input file: some_script > > You are saying my last command above should work with pathscript on? > --=20 Mark J. Reed --000000000000de495a060fdb7db9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When you set an option with setopt, that sets it fo= r the shell you are already in and typing commands to.=C2=A0

=
When you run /bin/zsh as a command, you are starting up a brand= new shell that does not inherit those options.

zsh% setopt pathscript =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0
zsh% = set -o | grep pathscript =C2=A0 =C2=A0 =C2=A0 =C2=A0
= pathscript =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0on
zsh% zsh -c '= set -o | grep pathscript'
pathscript =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0off

So doing = setopt pathscript=C2=A0has no effect= whatsoever on what a subsequent=C2=A0/bin/zsh = some_script=C2=A0will do. You have to do this instead:

/bi= n/zsh -o pathscript some_script


On Fri, Jan 26, 2024 at 10:50=E2=80=AFAM Steve Dondley <s@dondley.com> wrote:

You have this almost correct.=C2=A0 Sourcing for interactive mode has
= nothing to do with it.=C2=A0 It always applies to the scriptname argumentpassed to a new zsh, so it has to be in effect before zsh searches forthe script.

I may not be follow= ing you here.

If I have a script at ./dir/some_scr= ipt and I do:

> PATH=3D./dir
> set= opt pathscript

Then do

&g= t; /bin/zsh some_script

It will not look for the s= cript in $PATH as far as I can tell and fails with=C2=A0zsh: can't open= input file: some_script

You are saying my last co= mmand above should work with pathscript on?=C2=A0
<= /div>

--
Mark J. Reed <= ;markjreed@gmail.c= om>
--000000000000de495a060fdb7db9--