Side-by-side, interactive cheatsheets for Bash programmers
comparing Bash to other languages. Every example runs live in your browser — no
setup, no installation.
Choose your own path by reordering languages
The shell macOS made the default, Zsh runs almost all of your Bash scripts unchanged — the short list of things that genuinely differ is worth an afternoon, and the parameter flags you get in exchange retire a pile of tr/sort/uniq pipelines.
$variable stays one word, which retires the entire class of bugs caused by forgetting to quote$array means every element, not just ${array[0]}${(j:,:)list}, ${(s:,:)text}, ${(u)list}, ${(on)numbers} — join, split, deduplicate and sort with no external tool and no subprocess*(.om[1]) is the newest regular file — replace most everyday find invocationsalways blocks give the shell a real try/finally, scoped to a block instead of a single global EXIT trapemulate -L sh restores Bash rules for one function, so a ported script can migrate a piece at a timeThe pipe you already know, carrying data instead of text. Nushell keeps | and throws out the parsing — ls | where size > 1mb | sort-by modified needs no awk, no cut, and no counting of whitespace-separated fields.
get size instead of awk '{print $5}', and it cannot drift when the output format changesIFS — a value with a space in it is one value, in every context, with nothing to quotesort, uniq --count, length, first, where are builtins over typed data, so the sort | uniq -c | sort -rn chain collapses to one commandfrom json makes jq unnecessary — JSON, YAML, TOML, CSV and XML all decode into the same records and tablesbc; and 1kb and 1min + 30sec are typed values, not stringstry/catch, replacing set -euo pipefail and the $? dance