I own several computers and each is running different OS on it. We all know that maintaining different settings for different OS is very cumbersome. A simple solution for this is to separate common settings and machine-dependent settings into different files like this,
if [ -f $MBASHRC ]; then
echo "==> loading $MBASHRC"
In this way, all you need to do is to write your machine-dependent settings in the bashrc.darwin or bashrc.linux.