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

Re: Shell sourced function not available to executed script

On 8/13/2017 6:57 PM, Bart Schaefer wrote:
On Sun, Aug 13, 2017 at 4:15 PM, Clint Priest <cpriest@xxxxxxxxxxxxxxxx> wrote:
It would also seem that 'autoloaded functions' are also not available from
executed scripts...  I created it as an autoloaded function and it works
from the CLI just fine.

On 8/13/2017 6:02 PM, Clint Priest wrote:
In my case, I have a function:

Which is `source`ed into my environment.
This is going to depend on which of your startup files contain the
"source" or "autoload" commands.  Interactive and login shells load a
different set of ~/.z* files than do scripts.  Scripts typically read
only /etc/zshenv and ~/.zshenv.  For complete details, "man zsh" and
read the section on "Startup/Shutdown Files" (or section 5.1 in "info
zsh" if you have that available).

Makes sense, I'm not sure but I don't think bash behaves in this way. No matter, I can follow this pattern as well, thank you.



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