Including/Importing aliases and functions for both bash and zsh
I have a directory of functions and aliases I'd like to include for both bash and zsh terminal invocations (So I don't need to put every function and开发者_高级运维 alias into every separate script and to facilitate organization/tidying of .rc files)
What I've tried so far hasn't worked. Just setting this out for further suggestions.
For zsh I'm using
if [ -d ~/.zsh.d ]; then
for i in ~/.zsh.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
Should work for bash, too.
精彩评论