Re: broken by the FPATH environment variable defined by bash / lmod

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAHYJk3S+AXEq3tct_DAsDjrDkEPXirywDrTi21LF+gXWDKVz1w@mail.gmail.com>
On Tue, Aug 18, 2026 at 1:36 AM Vincent Lefevre <[email protected]> wrote:
>
> On 2026-08-17 15:56:23 -0400, Eric Cook wrote:
> > On 8/17/26 9:17 AM, Vincent Lefevre wrote:
> > > This is possibly due to /usr/share/lmod/8.7.60/init/bash from the
> > > lmod package, as mentioned at
> >
> > if bash learned about FPATH and autoloadable functions, then like
> > other shell variables, it shouldn't be exported (without good
> > reason) and that file is the problem.
>
> In the present case, I agree. But imagine that someone who doesn't
> know anything about zsh uses FPATH as an environment variable for
> their own use. This would break zsh scripts that use functions, like
>
> ----------------------------------------
> #!/usr/bin/env zsh
> autoload -U is-at-least
> is-at-least 5 && echo OK
> ----------------------------------------
>
> $ export FPATH=foo
> $ ./some-script
> is-at-least:4: is-at-least: function definition file not found
>
> Or do you assume that FPATH should universally be known?

https://lmod.readthedocs.io/en/latest/search.html?q=FPATH
It seems it is at least known by the software in question, though the
answer in the FAQ is pretty confusing, claiming it supports zsh and
then telling you to unset FPATH manually.

-- 
Mikael Magnusson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.