1
0
Fork 0
mirror of https://github.com/kastdeur/dotfiles.git synced 2024-11-13 07:03:32 +01:00
dotfiles/bash/bashrc
Eric Teunis de Boone 37123ca4cd Possiblity of having special setups for hostnames
For .Bashrc aswell as generic .Profile
2016-09-26 15:40:04 +02:00

37 lines
967 B
Bash

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
[ ! -z "$DOTFILES" ] && DOTBASH="$DOTFILES/bash"
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# Load main things
if [ -d "$DOTBASH/main" ]; then
for f in $DOTBASH/main/*; do
source "$f"
done
fi
# Try custom bashrc
#if [[ $HOSTNAME == 'hg'* && -r "hg.bashrc"]]; then
# source "hg.bashrc"
#fi
# Try hostname bashrcs
if [ -r "$DOTBASH/$HOSTNAME.bashrc" ]; then
source "$DOTBASH/$HOSTNAME.bashrc"
fi