Skip to content

Instantly share code, notes, and snippets.

@ryanwoodsmall
Created May 21, 2020 20:42
Show Gist options
  • Save ryanwoodsmall/a0c5d62c78cc796527ccdf2318871c13 to your computer and use it in GitHub Desktop.
Save ryanwoodsmall/a0c5d62c78cc796527ccdf2318871c13 to your computer and use it in GitHub Desktop.
shells.md

https://hackaday.com/2020/05/21/linux-fu-alternative-shells/

There's no such extant thing as "pdksh" anymore; development has mostly been picked up by mksh, along with the OpenBSD pdksh fork. mksh can be found at: https://www.mirbsd.org/mksh.htm and some portable OpenBSD versions are available at https://github.com/dimkr/loksh and https://github.com/ibara/oksh - of these mksh is probably the most featureful and useful, and is a mostly drop-in replacement for any ksh88/POSIX sh script or interactive environment.

Note, however, that pdksh derivatives are all more like the classical "ksh88" than "ksh93." The Korn shell grew a number of very useful features - associative arrays, floating point math, etc. - in the newer ksh93 version. Bash has adopted some of these, but not all, and the pdksh continuations/clones will likely stick with ksh88 compatibility. The old AT&T AST repo has relatively up-to-date (and open source) ksh93: https://github.com/att/ast and the ksh2020 branch has a build system not stuck in 1993: https://github.com/ksh2020/ksh

Regarding ash, if you've used embedded Linux, you've probably used Busybox, and the primary shell is a fork of ash. NetBSD has an ash derivative as well. Debian's dash is fast - extremely so, compared to Bash. ash is a good option if you don't need features or desire strict POSIX compliance/absolute performance.

I started out using Bash 1.x, which didn't have a ton of features over regular Bourne shell or ash, so I switched to csh then tcsh for a long while. Don't recommend it, far too quirky. ksh93 was and is a great shell, but Bash is available basically everywhere, and with the 4.x release (over a decade ago) introduced associative arrays, which is the killer feature for scripting so Bash is what I use, as stock as possible. In the bad old days, commercial Unix vendors tended to add features to either ksh or (t)csh, so you used what they gave you; frankly, I'm glad that's not the case anymore.

zsh is very, very nice but in the same way I'd prefer to not (have to) use every module under the sun in a new piece of software, or every plugin in my Vim config, I'd honestly rather not entertain the idea of an "app store" in my shell. If that's your thing, good on you! fish seems fine as well, some of my LISP-y pals use it but it's not my bag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment