Note
To access the full Bash Style Guide, click the blue badge above or navigate to bsg.hthompson.dev.
Over the past few years, I've written many Bash scripts—some good, some bad, and some downright ugly. This guide distills the lessons I've learned into a set of best practices for writing safe, predictable, and maintainable Bash scripts.
This Bash Style Guide provides detailed recommendations for writing safe and predictable bash scripts. The guidelines in this document are a complete rewrite of the Bash Style Guide written by bahamas10, drawing inspiration from the core concepts and ideas in Wooledge's Bash Practices. While this guide expands upon and reinterprets those foundational principles, any practices not explicitly covered here should be assumed to align with the standards outlined in the aforementioned resources.
You are encouraged to fork this guide on GitHub for your own use and to contribute to its improvement.