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

Re: autoload variables



On Mon, Aug 30, 2021 at 2:34 PM René Neumann <lists@xxxxxxxxx> wrote:
>
> As always: the tradeoff between having everything loaded "just in case"
> vs the "doing extra work when I need it".

As Roman said, "Zsh doesn't know which commands respect UPIF
environment variable".  If you can easily enumerate them, you could
write

function $(list of commands using UPIF) {
  export UPIF=$(....)
  unfunction $(list of commands using UPIF)
  command $0 "$@"
}

This could be combined with autoloading to keep the function bodies
out of shell memory until one of them is executed.




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