This is a card in Dave's Virtual Box of Cards.

The paradox of POSIX

Page started: 2026-03-05
Draft!
This page is a draft and may be incomplete, incorrect, or just a stub or outline. I've decided to allow myself to put draft pages on my website as an experiment. I'm hoping they will:
  • Help me address my backlog of article ideas.
  • Serve as a "living" TODO list of things to work on.
  • Be useful to myself or others in their incomplete forms.
As always, I'm happy to accept feedback on anything I publish including draft content.

NOTE TO SELF: The point of this article is to say that POSIX exists to provide a common environment

TODO: re-read the origins of posix. i seem to recall some interesting quotes from stallman about it.

I’ve seen a lot hand wringing over the years about writing POSIX-compatible shell scripts. Since POSIX shell is so restrictive, people go to great pains to accomplish this.

But getting a system without one of the common shells like Bash or Korn or even zsh is super rare. The real problem is all of the other tools.

I’ve been moving from Slackware Linux to OpenBSD on several of my personal computers, I’ve had to make changes to a number of my scripts and aliases to accommodate the differences.

My solution has been to rewrite my shell tools in Ruby, which makes it so much easier to write them that i usually end up adding some nice-to-have additional features while i’m at it.

The enormous advantage of Ruby is that the language and core libraries that ship with it provide 90% of what I need in terms of functionality. And for what it doesn’t provide, I just shell out. No problem!

(if I don’t already, i need a card talking about how Ruby is actually a serious contender for best cli scripting language so i can link it here - i completely ignore the object-oriented stuff, use globals, etc. it’s great)

I struggle to imagine someday ending up on a system that doesn’t support Ruby.

POSIX tools vs Perl

Perl is even more ubiquitous than ruby. openbsd considers perl to be one of the core languages that ships with a base system along with c and sh (TODO: get a link to this written somewhere)

perl 5 has reached a natural stasis, in contrast with posix which was an artificial cryogenic lock

(disclaimer?: I haven’t been a fan of Perl for a long time, but I was once an ardent fan!)