Linux Blog

Bash Scripting Dry Run

Filed under: Quick Linux Tutorials,Shell Script Sundays — at 1:37 am on Sunday, September 12, 2010 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:

Man Pages for commands in this post »



Comment by Anonymous

October 5, 2011 @ 6:45 pm

Okay, but how do you do this, you freaking faggot?

Comment by

October 5, 2011 @ 8:32 pm

@anon Simple: put an echo in front of it, how hard is it?

Comment by another anonymous

March 27, 2017 @ 7:50 am

Something like

would be desirable for the designated reader, if I understand the comment by ANONYMOUS correctly…

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>