I have been using my Mac and Linux computers a lot more recently. Syncing configurations between the two machines is pretty easy with tools like JungleDisk or Dropbox. Today I just started syncing my .bashrc and .bash_profile between the two systems. There are some configurations that need to be different on a per machine basis however. I wrote this quick little bash script to illustrate an easy way to do this. Pretty trivial but useful nonetheless.
OS=`uname`
if [ "$OS" = "Darwin" ]; then
echo "Running on Mac"
else
echo "Running on Linux"
fi
Also, uname -n
will return the computer name if you want to check that as well.