Created
October 17, 2012 19:10
-
-
Save 573/3907478 to your computer and use it in GitHub Desktop.
~/.bashrc file for using *.bashrc files inside a ~/.bashrc.d folder to load different stuff for a shell session - environment etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To pick up the latest recommended .bashrc content, | |
# look in /etc/defaults/etc/skel/.bashrc | |
# Modifying /etc/skel/.bashrc directly will prevent | |
# setup from updating it. | |
# The copy in your home directory (~/.bashrc) is yours, please | |
# feel free to customise it to create a shell | |
# environment to your liking. If you feel a change | |
# would be benificial to all, please feel free to send | |
# a patch to the cygwin mailing list. | |
# User dependent .bashrc file | |
# ... | |
if [ -d ~/.bashrc.d ]; then | |
for file in $(/bin/ls ~/.bashrc.d/*.bashrc); do | |
. $file; | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the same result in one line:
source <(cat ~/.bashrc.d/*.bashrc 2>/dev/null)
To setup the directory use
mkdir ~/.bashrc.d && chmod 744 ~/.bashrc.d