(I have seen this question, but not sure, if it's the same)
I use a lot of alias
in my .bashrc
script.
Is there any way, to use many different .bashrc
scripts?
for example
git.bashrc
alias gpull='git pull'
alias gcom='git commit -a -m '
alias gpush='git push'
alias gstat='git status'
alias gco='git checkout'
ide.bashrc
alias idea='/home/myname/dev/ide/idea/bin/idea.sh'
alias idea='/home/myname/dev/eclipse/eclipse/bin/eclipse.sh'
normal .bashrc
should include something like
include ide.bashrc
include git.bashrc
# normal stuff like:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
I want to use version control to have them on all my computers, but I can't really use the complete bashrc file for it. Thanks a lot!
for rcfiles in git.bashrc ide.bashrc; do if [[ -e "$rcfiles" ]]; then source "$rcfiles"; fi; done
You need to add the absolute path for the rcfiles if needed. Maybe add the-f
test also.