Where to start First steps track · 15 stages
Linux Labs

shellcheck — checking scripts before they run

cheat sheet · Ubuntu 24.04 · ShellCheck 0.9 https://lab.dimsanych.ru/en/wiki/shellcheck/

Cheat sheet

  • shellcheck backup.sh check a script
  • shellcheck *.sh several files at once
  • shellcheck -f gcc backup.sh one line per finding
  • shellcheck -S warning backup.sh only warnings and errors
  • shellcheck -e SC2034 backup.sh hide this code
  • shellcheck -x backup.sh follow files pulled in by source
  • shellcheck -s bash lib.sh no shebang — treat it as bash
  • shellcheck -f diff backup.sh ready-made fixes as a diff

Options

The main options are in the table below. The full list is in man shellcheck.

Loading…