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

Re: Best practices for managing aliases in ohmyzsh?



On Wed, Sep 1, 2021, at 12:20 PM, Ray Andrews wrote:
> On 2021-08-31 8:27 p.m., Lawrence Velázquez wrote:
> >> If a function is declared (yes I know, wrong word but you get my
> >> meaning) then the function enters memory, otherwise it's
> >> interpret-and-forget until next time, no?
> > I don't really know what you mean here.
> When we source a function it's there in memory for next time, no?

Singling out functions obscures what is going on.  All changes to
the sourcing shell's state persist, not just function definitions.

> Otherwise a script is freshly read each time it is sourced.  I"m pretty 
> sure about this.

The file is always read each time it is sourced (setting aside .zwc
files and what not).  It does not matter whether it defines functions
or not.

(I really hope you are not conflating sourced files with autoloaded
functions.)

-- 
vq




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