Linux Blog

Bash Scripting Dry Run

Filed under: Quick Linux Tutorials,Shell Script Sundays — TheLinuxBlog.com at 1:37 am on Sunday, September 12, 2010

http://www.flickr.com/photos/redteam/Occasionally when scripting it is desirable to not perform an action when modifying or creating a new script. In this case it is nice to be able to do a dry run similar to –dry-run for make.


When I’m making a script I’ve learned the hard way to:

  1. Make backups before hand
  2. Make backups while performing operations
  3. 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/

Advanced Bash-Scripting Guide

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:38 pm on Monday, November 24, 2008

Today the Advanced Bash-Scripting guide has been updated: http://www.tldp.org/LDP/abs/html/

Changelog: “Many bugs were fixed. Additionally, there is a great deal of new material. Editing was done for increased consistency. Two new example scripts were added.”

This is not a book that everyone will want to read, but for those wanting to know more about scripting or those with bash scripting knowledge its a must. Its available in a couple of formats for your reading pleasure.