Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Can't tell the difference in operation between PATH_SCRIPT and NO_PATH_SCRIPT



On Thu, Jan 25, 2024 at 9:20 PM Steve Dondley <s@xxxxxxxxxxx> wrote:
>
> It looks to me like the pathscript setting can only affect future commands if it’s either:
>
> a) used with +o or -o as part of an argument passed directly to zsh while running a script
> b) or if it’s set in a .zshrc file (or other config file) and then sourced when a new shell (interactive mode)
>
> Please tell me I have this correct otherwise I’m still badly confused.

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.

For completeness, the following also enable path_script:

c) "zsh --emulate sh scriptname" or "zsh --emulate ksh scriptname"
d) zsh is invoked by the name "sh" or "ksh" via a filesystem link
e) ARGV0=sh or ARGV0=ksh is in the environment when zsh is invoked




Messages sorted by: Reverse Date, Date, Thread, Author