views:

51

answers:

1

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.

+4  A: 

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.

Florian Diesch