๐ The Shell Landscape
Not all shells are equal. Understanding the differences is critical for writing portable scripts.
๐ The Main Contenders
| Shell | POSIXยน | Default On | Vibe / Use Case |
|---|---|---|---|
| sh (Bourne) | โ Yes | Alpine, Minimal Linux | The granddaddy. Strict, portable, minimal. |
| bash (Bourne Again) | โ ๏ธ Mostly | Most Linux distros | The industry standard. Powerful but full of "bashisms". |
| zsh (Z Shell) | โ ๏ธ Mostly | macOS, Kali | Modern, plugin-heavy, great for interactive use. |
| dash (Debian Almquist) | โ Yes | Debian/Ubuntu (/bin/sh) |
Fast, lightweight, strictly POSIX. |
| fish (Friendly) | โ No | N/A (User install) | Beautiful, auto-suggestions, non-standard scripting. |
| ksh (Korn) | โ ๏ธ Mostly | AIX, Solaris | Legacy enterprise UNIX. |
๐ The /bin/sh Trap
On modern systems, /bin/sh is often a symlink, not a real shell.
1 2 3 | |
โ ๏ธ DevOps Rule: Never assume
shisbash. If you write#!/bin/sh, you are promising to only use POSIX features.
๐ ๏ธ Check Your Shell
1 2 | |
ยน POSIX: A family of standards for maintaining compatibility between operating systems.