sh Checker — POSIX-First Shell Analysis
An sh checker that treats POSIX portability as a first-class concern. Paste any `#!/bin/sh` script and see every Bash-only construct flagged, plus the usual syntax and safety checks.
Bashisms the sh checker flags
#!/bin/sh
if [[ -n $x ]]; then # sh: [[ ]] is Bash-only; use [ ] for POSIX
arr=(a b c) # sh: arrays are Bash-only
echo "${arr[0]}" # sh: not POSIX
fi
Why POSIX portability matters
A script with `#!/bin/sh` may execute under `dash` on Debian/Ubuntu, `ash` in BusyBox containers, or `bash --posix` on other systems. Bashisms silently break in production even when they work on your laptop.
What the sh checker inspects
Every Bash-only construct (`[[ ]]`, arrays, process substitution, local, functions with the `function` keyword) is flagged. Plus the standard checks: quoting, unset variables, missing set -eu, unchecked exit codes.
Alternatives compared
checkbashisms is Debian-only and text-based. The online sh checker gives you the same coverage plus a broader safety and quality review, all in a browser.
Frequently asked questions
- What shells does the sh checker target?
- POSIX sh — dash, ash, and bash --posix. Bashisms are flagged as portability issues.
- Can I use it for Bash scripts too?
- Yes — if the shebang is #!/bin/bash, Bashisms are allowed and the checker focuses on Bash safety issues.
- Does it check for BusyBox compatibility?
- It flags features that are Bash-specific and typically absent from BusyBox `ash`; it does not enumerate every BusyBox build option.