8 Tips for Creating Better Bash Scripts

93

When I was first got started with administrating Linux and Unix servers I was working in an environment where there were tons of adhoc scripts that other admins wrote. From time to time I would find myself troubleshooting why one of those scripts suddenly stopped working. Sometimes the scripts would be well written and easy to understand, other times they were clunky and confusing.

While troubleshooting the poorly written scripts was always a hassle at the time, it taught me an important lesson. It showed me that even if you don’t think a script is going to be used beyond today, it is always best to write your scripts as if someone will be troubleshooting them two years later. Because, someone might be and sometimes that someone might even be yourself.

For today’s article I wanted to cover a few tips that will make your scripts better, not better for you but better for the next person who has to figure out why it isn’t working anymore.

 

Read more at bc-log