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.shcheck a script -
shellcheck *.shseveral files at once -
shellcheck -f gcc backup.shone line per finding -
shellcheck -S warning backup.shonly warnings and errors -
shellcheck -e SC2034 backup.shhide this code -
shellcheck -x backup.shfollow files pulled in by source -
shellcheck -s bash lib.shno shebang — treat it as bash -
shellcheck -f diff backup.shready-made fixes as a diff
Options
The main options are in the table below. The full list is in
man shellcheck.