---
layout: feed_post
title: "g.bash: A simple Bash framework"
slug: 611418d29444004b82e03edb
date: 2021-08-11 11:00:00
tags: feed
permalink: /feed/2021-08-11-gbash-a-simple-bash-framework/
feedtags:
  - Side Project
---
<br>
<p>
	Between work and my personal lab, I write a lot of command-line tools to help automate various tasks. But, as anyone who's worked with Bash before knows, adding multi-command support, flags, and other handling can be difficult to get off the ground.
</p>
<p>
	However, including a multi-file Bash framework is kinda... gross. One of the benefits of a shell script is that it can usually be distributed as a single-file affair. I was also unpleased with the current state of Bash argument-parsing.
</p>
<p>
	Enter: <code>g.bash</code>. This is my take on a single-file framework and standard library for Bash that addresses these issues. I might write a more extensive blog in the future, but for now the broad strokes are:
</p>
<ul>
	<li>Utility &amp; array helpers</li>
	<li>Filesystem helpers</li>
	<li>Error handling &amp; try-catch</li>
	<li>String manipulation helpers</li>
	<li>Logging to standard error/files by levels/flags</li>
	<li>Math constants &amp; helpers</li>
	<li>Import system w/ singleton includes</li>
	<li>Configuration file system</li>
	<li>Command definitions &amp; argument parsing</li>
	<li>Locking &amp; singleton execution</li>
</ul>
<p>
	This side-project is still very much a work-in-progress, but if you're curious you can check it out <a href="https://code.garrettmills.dev/garrettmills/g.bash" target="_blank">here</a>.
</p>