Function Libraries using FPATH

At our site we have a function library that contains several functions that are called via FPATH. We're using ksh and have environment variables in our .profile that link us to these as follows:

export CIRC_LIB=/apps/usr/circ/circ_lib
export FPATH=$CIRC_LIB

My questions are: When are the functions loaded? At login? Are they some how cached?

The reason I'm asking is that is seem as though unless one logs out and back on newer, or changed, versions of these functions don't work properly.

Perhaps someone can point me to some information on this. Thanks, in advance, for any assistance.

If the FPATH functions are invoked during login they remain in memory unchanged.
You do have to log out and back in again -- in this case.

alias is a better way of handling the problem - assuming these functions change often.

You can "unset -f" to lose the old definition. I think this also removes the autoload attribute, so if they were autoloaded, you might need to reset that.

I often reload the .profile by (ksh syntax):

. $HOME/.profile

This is done with some other shells by:

source $HOME/.profile

You might need a different path.

Greetings, William.

unset -f does clear the functions from memory. I thought he meant that the function declarations were in /etc/profile. Depending on what's in that file, simply rerunning it may trash the PATH variable and other settings.

We tell users just to logout & then login. That way there's less chance for problems.
Especially if the functions are updated only rarely.