Shell Scripting Guides

Set Up Shell Development Environment
Installation
sudo apt install shellcheck

Shell Style Guide
Shell Script Heading
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tomáš Havlas <tomas@havlas.me>
Bash "Strict Mode"
set -euo pipefail
Error Log Function with Timestamp
function log() {
  echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
}
if ! do_something; then
  log "Unable to do_something"
  exit 1
fi

Shell Snippet Collection
Write line same length as variable text
head -c "${#VARNAME}" </dev/zero | tr '\0' '-'