I have folder with number of different files that contains functions. I use declare to publish those functions to users. This is sample function I use:
space () {
df -h
}
declare -f space
Under user .bashrc I have added following:
for FILE in $HOME/functions/* ; do source $FILE ; done
However I get this message:
-bash: source: /home/user/functions/subdirectory: is a directory
Can anyone advise how to fix that or maybe there is better way to load functions to shell variables not to environment variables?
Thanks for all answers and here is the update what works for me.
Thanks for help