
Ron via Talk said on Wed, 23 Jul 2025 23:13:18 -0700
Dave at YSAP has a nice little 3 minute video on syntax checking bash scripts.
He introduces the `bash -n` feature and compares and contrasts it with https://www.shellcheck.net/ for doing that (and more).
If 3 minutes is too long, `bash -n` syntax checks without executing the script.
It's matched to *your* specific version of bash.
It considers an empty file valid (as no errors occurred).
:-) URL please? I conducted a brief investigation that concluded: 1) shellcheck is *much* stricter than bash -n 2) bash -n appears to work on my ksh scripts as well as bash So where I see bash -n fitting in is as a course first test. Get all the errors and warnings out with bash -n, and *then* use shellcheck to nail the rest of the errors and warnings that fell through the (wider) cracks of bash -n. SteveT Steve Litt http://444domains.com