Bash
Cheat sheet · https://pcornel.dk/topic.php?topic=2681
Answer
Bash is the GNU Bourne-Again Shell, the default interactive shell on most distributions. It adds arrays, [[ ]] tests, brace expansion, history and better scripting to the POSIX sh language.
Remember
Start scripts with #!/usr/bin/env bash or #!/bin/bash and set -euo pipefail to stop on errors. Quote variables ("$x"). Check scripts with shellcheck.
First checks
bash -x script.sh— trace each expanded commandbash -n script.sh— syntax check onlyshellcheck script.sh— common bugs and quoting problemsecho $?— exit code of the last command
Commands
bash --version- Read current Shell & Automation state for a bounded verification step.
Verify in this order
script starts with the Bash shebang → parsed → each line expanded → commands run → exit code returned
Where it usually breaks
First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2681