sh Linter — POSIX-Aware Static Lint
An sh linter that respects the `#!/bin/sh` contract. Every finding is portable to dash, ash, and bash --posix.
Common lint findings for sh
if [ "x$var" = "xyes" ]; then # lint: modern POSIX doesn't need the x prefix
files=`ls` # lint: prefer $(); avoid parsing ls
echo -e "hi" # lint: echo -e is not portable; use printf
fi
What the sh linter checks
ShellCheck-family rules filtered for POSIX applicability, plus explicit bashism detection when the shebang is #!/bin/sh.
Why lint POSIX explicitly
A script that works under bash may silently break under dash in a container. POSIX-aware lint catches those regressions before your CI does.
Fits any workflow
Paste, review, copy findings into a PR. No local install needed — works from a locked-down laptop or a phone.
Frequently asked questions
- Is this a replacement for ShellCheck?
- It covers overlapping ground. Both are worth running — this for interactive review, ShellCheck in CI.
- Does it flag all bashisms?
- The common ones: [[ ]], arrays, process substitution, `source`, `local`, `function` keyword, `echo -e`. Bash extensions in the wild are large; if you hit one it misses, tell us.
- Does the linter suggest fixes?
- Yes — each finding includes a portable rewrite when one exists.