Like many of you, I maintain and work on many unix machines on a regular basis. Unlike many of you, I'm a bit off when it comes to my obsession of maintaining my login scripts and prefs across those machines. :) My login scripts and prefs have been evolving for ~10 years as I've picked up tricks and tips from various friends' versions, blatantly ripped off bits here and there, and modified them for use in various OSes and shells as needed. Because I've spent so much time feeding, grooming and caring for them, I wanted a way to keep them consistent across all the machines and operating systems I use.
Many years ago a friend and I began using CVS to help organize our collaborative work. The lightbulb went on and soon after my login scripts found themselves happily residing in CVS and, therefore, on every machine I use ... in perfect sync. Ahhhh. :)
I did need a way to keep the packaged login scripts and preference files tidy and make them work with shells expecting them to be in specific locations. I chose an arbitrary directory name in my home folder (corresponding with the name of the module on the CVS server) to keep them in. I call it transport. Inside transport are versions of my various login scripts and preference files I like to keep in sync across machines (without the leading dot for editing ease). I check them out on a new machine and symlink to them from the proper, shell expected location... ie:
% cd ~wagner % ln -s transport/cshrc .cshrcI do this for my login scripts (tcsh, .login, .login, etc.), .vim, .vimrc, .xinitrc, .screenrc, and other pref files. Each time I modify one of these items, I commit those changes to the CVS server and, when I log into another machine, I update that set with the version on the CVS server. This works great for other sets of items you may want to keep in sync across machines as well. ie: maintaining all your administration scripts across machines in a similar way.
# osx stuff if (`uname` == 'Darwin') then alias top 'top -u' endifbash users could use something like:
# osx stuff if [ `uname` = "Linux" ] then alias ls='puke1' fiIf I am on a linux machine this conditional returns false and, therefore runs top with no arguments. If I am on an OS X machine, it will run top with the -u argument. You can use a hostname conditional to set up different aliases based on the host name. When I excitedly begin to explain these ideas to my friends, they tend to look at me sideways and slowly shuffle away. :) I hope some of you here can use and benefit from them and I would appreciate any suggestions or ideas on improving upon them.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031112200648344