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
24 default allows extensions permitted by Policy but may also provide
25 options 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 --extra, -x
45 Highlight lines which, whilst they do not contain bashisms, may
46 be useful in determining whether a particular issue is a false
47 positive which may be ignored. For example, the use of
48 "$BASH_ENV" may be preceded by checking whether "$BASH" is set.
49
50 --version, -v
51 Show version and copyright information.
52
54 The exit value will be 0 if no possible bashisms or other problems were
55 detected. Otherwise it will be the sum of the following error values:
56
57 1 A possible bashism was detected.
58
59 2 A file was skipped for some reason, for example, because it was
60 unreadable or not found. The warning message will give details.
61
63 lintian(1).
64
66 checkbashisms was originally written as a shell script by Yann Dirson
67 <dirson@debian.org> and rewritten in Perl with many more features by
68 Julian Gilbey <jdg@debian.org>.
69
70
71
72DEBIAN Debian Utilities CHECKBASHISMS(1)