开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜