zsh-users
 help / color / mirror / code / Atom feed
From: "Mark J. Reed" <markjreed@gmail.com>
To: Steve Dondley <s@dondley.com>
Cc: Bart Schaefer <schaefer@brasslantern.com>, zsh-users@zsh.org
Subject: Re: Can't tell the difference in operation between PATH_SCRIPT and NO_PATH_SCRIPT
Date: Fri, 26 Jan 2024 11:07:11 -0500	[thread overview]
Message-ID: <CAA=-s3yqXqoaju9LqSZX=MZ0VRhg1+ExRQyQiYCCkkNUr=ke_A@mail.gmail.com> (raw)
In-Reply-To: <316F625D-EC13-43C5-808F-B78DD09E906C@dondley.com>

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

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 AM Steve Dondley <s@dondley.com> wrote:

>
>
> 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=./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?
>


-- 
Mark J. Reed <markjreed@gmail.com>

[-- Attachment #2: Type: text/html, Size: 2975 bytes --]

  reply	other threads:[~2024-01-26 16:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  2:00 Steve Dondley
2024-01-26  3:05 ` Lawrence Velázquez
2024-01-26  3:21   ` Steve Dondley
2024-01-26  3:30     ` Steve Dondley
2024-01-26  3:45     ` Lawrence Velázquez
2024-01-26  4:17       ` Steve Dondley
2024-01-26  4:58         ` Lawrence Velázquez
2024-01-26  5:20           ` Steve Dondley
2024-01-26  5:52             ` Bart Schaefer
2024-01-26  6:35               ` Lawrence Velázquez
2024-01-26 15:49               ` Steve Dondley
2024-01-26 16:07                 ` Mark J. Reed [this message]
2024-01-26 16:41                   ` Mark J. Reed
2024-01-26 17:21                     ` Steve Dondley
2024-01-26 18:28                       ` Ray Andrews
2024-01-26 18:38                         ` Roman Perepelitsa
2024-01-26 19:17                           ` Steve Dondley
2024-01-26 19:38                             ` Roman Perepelitsa
2024-01-26 19:52                               ` Steve Dondley
2024-01-26 20:06                                 ` Ray Andrews
2024-01-26 20:16                                   ` Lawrence Velázquez
2024-01-26 19:54                             ` Ray Andrews
2024-01-26 20:05                               ` Steve Dondley
2024-01-26 20:43                               ` Steve Dondley
2024-01-27  2:34                             ` .m0rph
2024-01-26 19:42                           ` Ray Andrews
2024-01-26 20:08                             ` Roman Perepelitsa
2024-01-26 20:21                               ` Steve Dondley
2024-01-26 20:40                               ` Ray Andrews
2024-01-26  6:25             ` Lawrence Velázquez
2024-01-26  6:42               ` Lawrence Velázquez
2024-01-26 15:27               ` Steve Dondley
2024-01-26  4:35 ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA=-s3yqXqoaju9LqSZX=MZ0VRhg1+ExRQyQiYCCkkNUr=ke_A@mail.gmail.com' \
    --to=markjreed@gmail.com \
    --cc=s@dondley.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).