checkbashisms.1 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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\fR|\fB\-\-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 "\fBecho \-n\fR" 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 \fB\-n\fR).
  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 "\fB$BASH_ENV\fR" may be preceded by checking
  45. whether "\fB$BASH\fR" 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. .TP
  61. 4
  62. No bashisms were detected in a bash script.
  63. .SH "SEE ALSO"
  64. .BR lintian (1)
  65. .SH AUTHOR
  66. \fBcheckbashisms\fR was originally written as a shell script by Yann Dirson
  67. <\fIdirson@debian.org\fR> and rewritten in Perl with many more features by
  68. Julian Gilbey <\fIjdg@debian.org\fR>.