CHECKBASHISMS(1)
β¨ CHECKBASHISMS(1) β¨
okay bestie, welcome to checkbashisms from the General Commands Manual section of your local man pages π this is the lil tool that sniffs out bashisms hiding in your /bin/sh scripts, and yes she WILL call you out. lovingly. π«Ά
πΈ NAME πΈ
checkbashisms β check for bashisms in /bin/sh scripts π΅οΈβοΈβ¨
π¦ SYNOPSIS π¦
checkbashisms script ...
checkbashisms --help|--version
π DESCRIPTION π
so like. checkbashisms is based on one of the checks from the lintian system, and what she does is run basic checks on your /bin/sh shell scripts to see if there's any possible bashisms lurking in there π You hand her the names of the shell scripts on the command line, and she'll print warnings if she detects possible bashisms. that's it. that's the whole gig. she's very good at it.
ngl, the definition of a "bashism" here is roughly "a shell feature that is not required to be supported by POSIX" β which means some of the stuff she flags might actually be permitted under optional sections of POSIX, like XSI or User Portability. so don't come for her, she's just being thorough π
and when POSIX and Debian Policy disagree?? checkbashisms by default allows the extensions that Policy permits, but she also has options for stricter checking if you're feeling brave. main character energy fr fr π
π OPTIONS π
--help,-hβ show a summary of the options, for when you need a lil refresher β¨--newline,-nβ check forecho -nusage (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 (this one implies-n) π--force,-fβ force each script to be checked, even if it would normally not be, for instance because it has a bash or non POSIX shell shebang or appears to be a shell wrapper. no skipping allowed, bestie πͺ--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_ENVmay be preceded by checking whether$BASHis set. she's giving context, she's giving receipts π--early-fail,-eβ exit right after a first error is seen. no notes, she's out πͺπ¨--version,-vβ show version and copyright information π
π EXIT VALUES π
the exit value will be 0 if no possible bashisms or other problems were detected. slay π
otherwise it'll be the sum of the following error values (yes, sum β they add up, so read carefully bestie):
1β a possible bashism was detected π2β a file was skipped for some reason, for example because it was unreadable or not found. the warning message will give you the details π4β no bashisms were detected in a bash script π
π SEE ALSO π
lintian(1)β go say hi to the mothership π
π AUTHOR π
checkbashisms was originally written as a shell script by Yann Dirson <dirson@debian.org> and rewritten in Perl with many more features by Julian Gilbey <jdg@debian.org>. legends, both of them, no cap π«Άβ¨
and that's the whole page, bestie!! this one lives in the Debian Utilities corner of the Debian manual pages, filed under CHECKBASHISMS(1) β go forth and de-bashify your scripts, you absolute icon ππ
π¦ where this page comes from
- alpine 3.22: debian-devscripts-doc 2.25.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: debian-devscripts-doc 2.25.28-r0 Β· GPL-2.0-or-later
- alpine 3.24: debian-devscripts-doc 2.26.5-r1 Β· GPL-2.0-or-later
- arch rolling: checkbashisms 2.26.13-1 Β· GPL-2.0-or-later
- debian bookworm: devscripts 2.23.4+deb12u2 Β· GPL-2.0-or-later
- debian trixie: devscripts 2.25.15+deb13u1 Β· GPL-2.0-or-later
- epel 10: devscripts-checkbashisms 2.25.5-1.el10_1 Β· GPL-2.0-or-later
- epel 9: devscripts-checkbashisms 2.25.5-1.el9 Β· GPL-2.0-or-later
- fedora 43: devscripts-checkbashisms 2.25.19-2.fc43 Β· GPL-2.0-or-later
- fedora 43: devscripts-checkbashisms 2.25.33-1.fc43 Β· GPL-2.0-or-later
- fedora 44: devscripts-checkbashisms 2.26.5-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: checkbashisms 2.25.10
- nixpkgs unstable: checkbashisms 2.25.10
- opensuse-leap 16.0: checkbashisms 2.22.2-160000.2.2 Β· GPL-2.0-or-later
- ubuntu jammy: devscripts 2.22.1ubuntu1 Β· GPL-2.0-or-later
- ubuntu jammy: devscripts 2.22.1ubuntu1.2 Β· GPL-2.0-or-later
- ubuntu noble: devscripts 2.23.7 Β· GPL-2.0-or-later
- ubuntu noble: devscripts 2.23.7ubuntu0.2 Β· GPL-2.0-or-later
- ubuntu questing: devscripts 2.25.19ubuntu2
- ubuntu resolute: devscripts 2.26.7 Β· GPL-2.0-or-later
- ubuntu stonking: devscripts 2.26.11ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms