# info > CHECKBASHISMS

---
type: CommandReference
command: checkbashisms
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `checkbashisms script [script...]` — check shell scripts for bashisms
- `checkbashisms -n script` — also check `echo -n` usage (Debian Policy required)
- `checkbashisms -p script` — check for strict POSIX compliance (implies `-n`)
- `checkbashisms -l script` — linter output format for editor integration
- `checkbashisms -x script` — highlight lines that may help identify false positives
- `checkbashisms -e script` — exit after first error found
- `checkbashisms -f script` — force checking even if script has bash or non-POSIX shebang
- `checkbashisms --help` — show usage summary
- `checkbashisms --version` — show version and copyright

## Name

checkbashisms — check for bashisms in /bin/sh scripts

## Synopsis

`checkbashisms [options] script...`
`checkbashisms --help|--version`

## Description

Performs basic checks on `/bin/sh` shell scripts for possible bashisms (features not required by POSIX). Flags may include extensions permitted under optional POSIX sections (XSI, User Portability) or by Debian Policy. Options allow stricter checking.

## Options

- `-h, --help` — Show a summary of options.
- `-n, --newline` — Check for `echo -n` usage (non-POSIX but required by Debian Policy 10.4).
- `-p, --posix` — Check for issues non-POSIX but required by Debian Policy 10.4 (implies `-n`).
- `-f, --force` — Force each script to be checked, even if normally skipped (e.g., bash or non-POSIX shebang, shell wrapper).
- `-l, --lint` — Linter output format: `{filename}:{lineno}:1: warning: possible bashism; {explanation}`.
- `-x, --extra` — Highlight lines that, while not containing bashisms, may help identify false positives (e.g., `$BASH_ENV` preceded by `$BASH` check).
- `-e, --early-fail` — Exit right after first error is seen.
- `-v, --version` — Show version and copyright information.

## Exit Codes

Exit code is 0 if no issues detected. Otherwise, sum of:

- `1` — A possible bashism was detected.
- `2` — A file was skipped (e.g., unreadable or not found). Warning message gives details.
- `4` — No bashisms detected in a bash script.

## See Also

[lintian(1)](http://localhost/phpMan.php/man/lintian/1/markdown)