In AIX, I have a, FPATH set function, which is globally accessible by just calling the function name. I am trying to replicate this functionality in Linux. I set the function in $PATH variable, I tried sourcing the script. But still I get Function not found error.
If I call the function script with absolute path, it works. example: FmtMg is the function I place the file in /usr/local/lib directory
export $PATH=$PATH:/usr/local/lib/FmtMg
source /usr/local/lib/FmtMg
I tried all these above, it still fails. Below is the script to test the function.
#!/bin/ksh
set -u # all variables must be set
unset -f FmtMg
autoload FmtMg
GM=`basename $0`
print "Testing FmtMg\n"
FmtMg -p$GM -l$LINENO -s0 "FmtMg Test Completed."
/usr/llocal/lib/FmtMg
then you wantPATH=...:/usr/local/lib
, not.../usr/local/lib/FmtMg