Koalephant Shell Script Library

Lobsters·2 points·stephenr·over 8 years ago·bitbucket.org

<p>I've been working on this, on-and-off for a while, and I've finally found the time to get it usable/reliable enough to make a public release.</p> <p>Shell being what it is, the library functions are largely just ways to make code more obvious (i.e. <code>k_string_pad_left 10 foo</code> vs <code>printf '%+10s' foo</code>).</p> <p>One big goal is portability, so wherever possible things are done in pure shell, or using POSIX-defined tools. For that reason, there are some current external tool uses (notably <code>cfget</code>) that I want to replace, and of course use of things like <code>gpg</code> basically requires the environment has a working implementation,</p> <p>One of the parts that's been both time consuming but also rewarding (in terms of mentally and in terms of results) has been <code>k-script-build</code>, which facilitates turning a script with relative source (<code>.</code>) statements into either a self-contained script (by inlining those scripts) or a script with absolute references (i.e. if you re-use a <code>.lib.sh</code> type file, and want to reference it in a location like <code>/usr/share</code>).</p> <p>The installed versions of the tools, and the library files are themselves built with <code>k-script-build</code> which in turn, relies on the library. It's dogfooding/self-hosting up the wazoo.</p>

Read the full article at bitbucket.org →

Related stories

Related topics