info > CHECKBASHISMS

πŸ“› NAME

checkbashisms - check for bashisms in /bin/sh scripts

πŸš€ Quick Reference

Use CaseCommandDescription
Check a script for bashismscheckbashisms script.shBasic check for possible bashisms in a POSIX shell script
Check with strict POSIX (includes -n)checkbashisms --posix script.shEnforce stricter POSIX compliance, flags non‑POSIX features allowed by Debian Policy
Check echo -n usagecheckbashisms --newline script.shSpecifically flag extensions like echo -n not required by POSIX
Force check all scriptscheckbashisms --force script.shOverride shebang detection and check even if script appears to be bash or a wrapper
Linter mode (editor integration)checkbashisms --lint script.shOutput warnings in a parseable format: filename:line:1: warning: ...
Show extra contextcheckbashisms --extra script.shHighlight lines that don’t contain bashisms but help identify false positives
Stop at first errorcheckbashisms --early-fail script.shExit immediately after the first found bashism

πŸ“‹ SYNOPSIS

checkbashisms script ...
checkbashisms --help|--version

πŸ“ DESCRIPTION

checkbashisms, based on one of the checks from the lintian system, performs basic checks on /bin/sh shell scripts for the possible presence of bashisms. It takes the names of the shell scripts on the command line, and outputs warnings if possible bashisms are detected.

Note that the definition of a bashism in this context roughly equates to β€œa shell feature that is not required to be supported by POSIX”; this means that some issues flagged may be permitted under optional sections of POSIX, such as XSI or User Portability.

In cases where POSIX and Debian Policy disagree, checkbashisms by default allows extensions permitted by Policy but may also provide options for stricter checking.

βš™οΈ OPTIONS

πŸ†˜ --help, -h

Show a summary of options.

πŸ†• --newline, -n

Check for β€œecho -n” usage (non POSIX but required by Debian Policy 10.4).

βœ… --posix, -p

Check for issues which are non POSIX but required to be supported by Debian Policy 10.4 (implies -n).

πŸ’ͺ --force, -f

Force each script to be checked, even if it would normally not be (for instance, it has a bash or non POSIX shell shebang or appears to be a shell wrapper).

πŸ” --lint, -l

Act like a linter, for integration into a text editor. Possible bashisms will be printed in stdout, like so:

{filename}:{lineno}:1: warning: possible bashism; {explanation}

βž• --extra, -x

Highlight lines which, whilst they do not contain bashisms, may be useful in determining whether a particular issue is a false positive which may be ignored. For example, the use of $BASH_ENV may be preceded by checking whether $BASH is set.

⏹️ --early-fail, -e

Exit right after a first error is seen.

ℹ️ --version, -v

Show version and copyright information.

πŸšͺ Exit Codes

The exit value will be 0 if no possible bashisms or other problems were detected. Otherwise it will be the sum of the following error values:

πŸ“š SEE ALSO

lintian(1)

πŸ‘€ AUTHOR

checkbashisms was originally written as a shell script by Yann Dirson <dirson AT debian.org> and rewritten in Perl with many more features by Julian Gilbey <jdg AT debian.org>.

CHECKBASHISMS
πŸ“› NAME πŸš€ Quick Reference πŸ“‹ SYNOPSIS πŸ“ DESCRIPTION βš™οΈ OPTIONS
πŸ†˜ --help, -h πŸ†• --newline, -n βœ… --posix, -p πŸ’ͺ --force, -f πŸ” --lint, -l βž• --extra, -x ⏹️ --early-fail, -e ℹ️ --version, -v
πŸšͺ Exit Codes πŸ“š SEE ALSO πŸ‘€ AUTHOR

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:00 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!