small pixel drawing of a pufferfish j3s.sh

spelling
Jes Olson j3s@c3f.net
Sat, 11 Mar 2023 00:27:03 -0800
commit

784ef0dcd736aa291a41908da57a0a388653ea14

parent

8e02e29e5260aa06ac6177adbbf7ef83b6a1e556

1 files changed, 13 insertions(+), 10 deletions(-)

jump to
M thought/write-posix-shell.htmlthought/write-posix-shell.html

@@ -95,13 +95,16 @@ tcsh. pdksh.

the list of shell dialects goes on and on forever, like a big long slimy snail trail. - each shell dialect has varying levels of compatability - with the others. for example, imagine writing - a bash shell script only to later realize that - it won't run inside of your alpine container, + each shell dialect has varying levels of compatibility + with the others. + + for example, imagine writing a bash shell + program only to later realize that it won't + run inside of your alpine container, because alpine uses dash. - imagine writing a shell script on macos, only - to realize that it isn't compatible with linux. + + imagine writing a shell script on macos only + to realize that it doesn't work on linux. when people write shell, they will often say things like "i'm writing bash" or "i'm bash scripting"

@@ -148,11 +151,11 @@ posix shell is defined:

the posix spec fully describes how shell should work. it defines every command, every flag, and every builtin function. it defines how loops work, how case statements - ought to look, yadda yadda. + ought to look, and how exit codes work. everything. posix shell is pretty small: if you enjoy reading technical specifications for - fun (aka: if you are a massochist), you might read + fun (aka: if you are a masochist), you might read through the posix spec - it'd only take a day or two. or, you might just read the parts of it that

@@ -274,7 +277,7 @@ here's a cool arch wiki entry[8] on shells, check out

the posix section. shellcheck[9] is an amazing tool that can check your shell - for posix compatability issues & many other things. + for posix compatibility issues & many other things. i use it every time i write more than a few dozen lines of shell.

@@ -282,7 +285,7 @@ shfmt[10] is like gofmt, but for shell. it supports posix

shell as well! - :D + :D :3 posix shell is fun, sloppy, powerful, portable, and eternal.