small pixel drawing of a pufferfish


{{ define "wat" }}
<!doctype html>
		body {color: #ffffff; background-color: #222222; font-family: monospace;}
		a    {color: #ffffff;}
		pre    {color: #ffffff;}
		sub    {color: #4e4e4e;}
		h1,h2,h4,h4,h5   {color: #ffffff96;}
	<!-- a production, again, lmao -->
	<meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Use POSIX Shell</title>

  <small>#!/bin/sh -eu</small>
  <small>cat &lt;&lt;EOF</small>
  <h4># use POSIX shell</h4>
  <p>POSIX shell is portable, easy to maintain, and works for 99% of scripting use-cases.</p>
  <p>command list: <a href=""></a></p>
  <p>example: <a href=""></a></p>
  <p>this site serves as a motivator as well as a desparate plea (USE POSIX SHELL PLS, I AM SO SICK OF ARCANE BASH SCRIPTS) and also a quick reference for POSIX compatability. it will eventually include a POSIX shellcheck interpreter. or something.</p>
  <!-- lmao escape -->

  <h4># what is POSIX shell?</h4>
  <p>POSIX shell is any shell script that adheres to the POSIX standard. <a href="">See this horrible document for excruciating details</a>. basically, if you write a shell script and follow the POSIX standard, you can mostly guarantee that it'll work _almost everywhere_.</p>

  <h4># there are two types of shell scripts in the world:</h4>
  <ul>- small, portable, maintainable POSIX shell scripts</ul>
  <ul>- incomprehensible spaghetti nightmare</ul>

  <h4># tips</h4>
  <h4># if it starts feeling confusing as fuck, stop using shell.</h4>
  <p>when you write only POSIX shell, it becomes very obvious when you should be using a real programming language. your script will begin seeming impossible to reason about. while shell is very powerful, it's also incredibly loose. it is fast and very productive, but becomes impenetrable VERY fast. if you cannot hold the entire script in your head, use a real language. for example, do you:</p>
  <ul>- need arrays? stop using shell</ul>
  <ul>- need strong types? stop using shell</ul>
  <ul>- need a lot of dependencies? stop using shell</ul>
  <ul>- need compile/runtime safety? stop using shell</ul>
  <p>see how easy it is? simple, maintainable shell. or none at all.</p>
{{ end }}