checkbashisms as a perl module fun
Monday, 30. June 2008, 03:41:52
$ checkbashisms.pl.4pm --debug --recursive --extra /etc/init.d/apache2
Variable "%bashisms" is not available at (eval 6) line 1.
[recursive mode]Delaying check of /lib/lsb/init-functions for bashisms from:
. /lib/lsb/init-functions
[srecursive mode]Path expanded to: /lib/lsb/init-functions
[recursive mode]Delaying check of /etc/default/rcS for bashisms from:
test -f /etc/default/rcS && . /etc/default/rcS
[srecursive mode]Path expanded to: /etc/default/rcS
[recursive mode]Delaying check of /etc/default/apache2 for bashisms from:
test -f /etc/default/apache2 && . /etc/default/apache2
[srecursive mode]Path expanded to: /etc/default/apache2
[recursive mode]Delaying check of /etc/apache2/envvars for bashisms from:
PFILE=`. /etc/apache2/envvars ; echo $APACHE_PID_FILE`
[srecursive mode]Path expanded to: /etc/apache2/envvars
status for /etc/init.d/apache2 is: 0
status for /etc/apache2/envvars is: 0
status for /lib/lsb/init-functions is: 1
possible bashism in /lib/lsb/init-functions line 31 (local x y):
local force nice pidfile exec i
possible bashism in /lib/lsb/init-functions line 62 (local x y):
local pidfile line i pids= status specified pid
possible bashism in /lib/lsb/init-functions line 81 (kill -[0-9] or -[A-Z]):
if $(kill -0 "${pid:-}" 2> /dev/null); then
status for /etc/default/rcS is: 1
status for /etc/default/apache2 is: 1
next step: fix remaining bugs, and integrate it in lintian (yes, finally lintian will be able to look for bashisms in all /bin/sh scripts
Those wondering what the "Path expanded to" lines are for:
$ checkbashisms.pl.4pm --debug --recursive --extra /etc/init.d/zope3
Variable "%bashisms" is not available at (eval 6) line 1.
[recursive mode]Delaying check of /lib/lsb/init-functions for bashisms from:
. /lib/lsb/init-functions
[srecursive mode]Path expanded to: /lib/lsb/init-functions
[recursive mode]Delaying check of /etc/default/zope$ZVER for bashisms from:
. /etc/default/zope$ZVER
[srecursive mode]Path expanded to: /etc/default/zope3
status for /etc/init.d/zope3 is: 0
status for /lib/lsb/init-functions is: 1
possible bashism in /lib/lsb/init-functions line 31 (local x y):
local force nice pidfile exec i
possible bashism in /lib/lsb/init-functions line 62 (local x y):
local pidfile line i pids= status specified pid
possible bashism in /lib/lsb/init-functions line 81 (kill -[0-9] or -[A-Z]):
if $(kill -0 "${pid:-}" 2> /dev/null); then
status for /etc/default/zope3 is: 1
Btw, srecursive isn't a typo, it stands for "smart recursive" (i.e. replace $vars with * and glob)







