I have shell scripts in my
~/Shell directory that I want to be run whenever Bash is started up as my usual user account. So what I have done is added the following to
for i in `find ~/Shell/ -name "*.sh"` do sh $i done
but, for whatever reason the functions contained in files with the file extension
.sh in my
~/Shell directory are not automatically loaded. For example, I have a function called
abash in my
~/Shell/bash.sh file and running
abash from a new user terminal gave an error stating that the command was not found.
I know I can just manually list all the files in my
~/Shell directory with a dot before them to get them executed at Bash startup time. For example, I used to have this in my
. ~/Shell/bash.sh . ~/Shell/cd.sh . ~/Shell/emerge.sh ...
and it worked fine, but I would rather a
for loop to do this, as it would mean if I add any new shell scripts to
~/Shell I do not have to worry about adding them to
I have also now tried:
for i in `find -name "~/Shell/*.sh"` do sh $i done
for i in "~/Shell/*.sh" do sh $i done
for i in `find -name '~/Shell/*.sh'` do sh $i done
with no success.