chiark / gitweb /
devscripts (2.10.69+squeeze4) stable-security; urgency=high
[devscripts.git] / scripts / checkbashisms.1
1 .TH CHECKBASHISMS 1 "Debian Utilities" "DEBIAN" \" -*- nroff -*-
2 .SH NAME
3 checkbashisms \- check for bashisms in /bin/sh scripts
4 .SH SYNOPSIS
5 \fBcheckbashisms\fR \fIscript\fR ...
6 .br
7 \fBcheckbashisms \-\-help|\-\-version\fR
8 .SH DESCRIPTION
9 \fBcheckbashisms\fR, based on one of the checks from the \fBlintian\fR
10 system, performs basic checks on \fI/bin/sh\fR shell scripts for the
11 possible presence of bashisms.  It takes the names of the shell
12 scripts on the command line, and outputs warnings if possible bashisms
13 are detected.
14 .PP
15 Note that the definition of a bashism in this context roughly equates 
16 to "a shell feature that is not required to be supported by POSIX"; this 
17 means that some issues flagged may be permitted under optional sections 
18 of POSIX, such as XSI or User Portability.
19 .PP
20 In cases where POSIX and Debian Policy disagree, \fBcheckbashisms\fR by 
21 default allows extensions permitted by Policy but may also provide 
22 options for stricter checking.
23 .SH OPTIONS
24 .TP
25 .BR \-\-help ", " \-h
26 Show a summary of options.
27 .TP
28 .BR \-\-newline ", " \-n
29 Check for "echo \-n" usage (non POSIX but required by Debian Policy 10.4.)
30 .TP
31 .BR \-\-posix ", " \-p
32 Check for issues which are non POSIX but required to be supported by Debian
33 Policy 10.4 (implies \-n).
34 .TP
35 .BR \-\-force ", " \-f
36 Force each script to be checked, even if it would normally not be (for 
37 instance, it has a bash or non POSIX shell shebang or appears to be a 
38 shell wrapper).
39 .TP
40 .BR \-\-extra ", " \-x
41 Highlight lines which, whilst they do not contain bashisms, may be
42 useful in determining whether a particular issue is a false positive
43 which may be ignored.
44 For example, the use of "$BASH_ENV" may be preceded by checking
45 whether "$BASH" is set.
46 .TP
47 .BR \-\-version ", " \-v
48 Show version and copyright information.
49 .SH "EXIT VALUES"
50 The exit value will be 0 if no possible bashisms or other problems
51 were detected.  Otherwise it will be the sum of the following error
52 values:
53 .TP
54 1
55 A possible bashism was detected.
56 .TP
57 2
58 A file was skipped for some reason, for example, because it was
59 unreadable or not found.  The warning message will give details.
60 .SH "SEE ALSO"
61 .BR lintian (1).
62 .SH AUTHOR
63 \fBcheckbashisms\fR was originally written as a shell script by Yann Dirson
64 <dirson@debian.org> and rewritten in Perl with many more features by
65 Julian Gilbey <jdg@debian.org>.