I am one of those type of people that like to make backup copies of files before I tinker with them, especially when I am modifying important files like system stuff. It's always a good idea to make a backup copy before you edit something so you can put it back if you break it. For that reason, I wrote this simple little PERL script that I then put somewhere in my path so I can run it from anywhere. I call it simply "bu" so that it's easy to type and use. What it does is copy the target file you specify, to a file of the same name only with a date stamp appended to it. I have found this to be a really handy tool, so I thought I would share.
#!/usr/bin/perl
if ($ARGV[0] eq "") {
die("No file specified!\n");
} else {
`cp -p $ARGV[0] $ARGV[0].\`date +%m%d%y_%H%M%S\``
}
Check it out, I hope you find it as useful as I have.