When I’m making a script I’ve learned the hard way to:
- Make backups before hand
- Make backups while performing operations
- Perform mock dry runs by using echo liberally.
So next time you’re trying to do something complex and don’t want to do something goofy, stick an echo in there before running it and save yourself some time.
Image Source: http://www.flickr.com/photos/redteam/