1CHECKBASHISMS(1) General Commands Manual CHECKBASHISMS(1)
2
3
4
6 checkbashisms - check for bashisms in /bin/sh scripts
7
9 checkbashisms script ...
10 checkbashisms --help|--version
11
13 checkbashisms, based on one of the checks from the lintian system, per‐
14 forms basic checks on /bin/sh shell scripts for the possible presence
15 of bashisms. It takes the names of the shell scripts on the command
16 line, and outputs warnings if possible bashisms are detected.
17
18 Note that the definition of a bashism in this context roughly equates
19 to "a shell feature that is not required to be supported by POSIX";
20 this means that some issues flagged may be permitted under optional
21 sections of POSIX, such as XSI or User Portability.
22
23 In cases where POSIX and Debian Policy disagree, checkbashisms by de‐
24 fault allows extensions permitted by Policy but may also provide op‐
25 tions for stricter checking.
26
28 --help, -h
29 Show a summary of options.
30
31 --newline, -n
32 Check for "echo -n" usage (non POSIX but required by Debian Pol‐
33 icy 10.4.)
34
35 --posix, -p
36 Check for issues which are non POSIX but required to be sup‐
37 ported by Debian Policy 10.4 (implies -n).
38
39 --force, -f
40 Force each script to be checked, even if it would normally not
41 be (for instance, it has a bash or non POSIX shell shebang or
42 appears to be a shell wrapper).
43
44 --lint, -l
45 Act like a linter, for integration into a text editor. Possible
46 bashisms will be printed in stdout, like so:
47
48 {filename}:{lineno}:1: warning: possible bashism; {explanation}
49
50 --extra, -x
51 Highlight lines which, whilst they do not contain bashisms, may
52 be useful in determining whether a particular issue is a false
53 positive which may be ignored. For example, the use of
54 "$BASH_ENV" may be preceded by checking whether "$BASH" is set.
55
56 --early-fail, -e
57 Exit right after a first error is seen.
58
59 --version, -v
60 Show version and copyright information.
61
63 The exit value will be 0 if no possible bashisms or other problems were
64 detected. Otherwise it will be the sum of the following error values:
65
66 1 A possible bashism was detected.
67
68 2 A file was skipped for some reason, for example, because it was
69 unreadable or not found. The warning message will give details.
70
71 4 No bashisms were detected in a bash script.
72
74 lintian(1)
75
77 checkbashisms was originally written as a shell script by Yann Dirson
78 <dirson@debian.org> and rewritten in Perl with many more features by
79 Julian Gilbey <jdg@debian.org>.
80
81
82
83DEBIAN Debian Utilities CHECKBASHISMS(1)