bashism in /bin/sh script in nagios/bin/

Bug #1504964 reported by Jan Wagner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Monitoring Plugins
New
Undecided
Unassigned

Bug Description

Running checkbashisms (https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.pl) against nagios/bin/* from the 1.1.5 release results into the following error.

Not using bash as /bin/sh is likely to lead to errors or unexpected behaviours. Please be aware that dash is the default /bin/sh in Debian (and Derivates) and maybe other Distributions.

possible bashism in nagios/bin/pmp-check-lvm-snapshots line 103 ($_):
   [ "${0##*/}" = "pmp-check-lvm-snapshots" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-deadlocks line 97 ($_):
   [ "${0##*/}" = "pmp-check-mysql-deadlocks" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-deleted-files line 154 ($_):
   [ "${0##*/}" = "pmp-check-mysql-deleted-files" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-file-privs line 147 ($_):
   [ "${0##*/}" = "pmp-check-mysql-file-privs" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-innodb line 237 ($_):
   [ "${0##*/}" = "pmp-check-mysql-innodb" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-pidfile line 163 ($_):
   [ "${0##*/}" = "pmp-check-mysql-pidfile" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-processlist line 184 ($_):
   [ "${0##*/}" = "pmp-check-mysql-processlist" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-replication-delay line 139 ($_):
   [ "${0##*/}" = "pmp-check-mysql-replication-delay" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-replication-running line 126 ($_):
   [ "${0##*/}" = "pmp-check-mysql-replication-running" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-status line 304 ($_):
   [ "${0##*/}" = "pmp-check-mysql-status" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-mysql-ts-count line 64 (should be 'b = a'):
   if [ "${OPT_TARGET}" == "kills" ]; then
possible bashism in nagios/bin/pmp-check-mysql-ts-count line 67 (should be 'b = a'):
   elif [ "${OPT_TARGET}" == "fkerrors" ]; then
possible bashism in nagios/bin/pmp-check-mysql-ts-count line 109 ($_):
   [ "${0##*/}" = "pmp-check-mysql-ts-count" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]
possible bashism in nagios/bin/pmp-check-unix-memory line 118 ($_):
   [ "${0##*/}" = "pmp-check-unix-memory" ] || [ "${0##*/}" = "bash" -a "$_" = "$0" ]

Hints about how to fix bashisms can be found at:
https://wiki.ubuntu.com/DashAsBinSh

Many thanks in advance for fixing this, Jan.

Jan Wagner (waja)
description: updated
Revision history for this message
Jan Wagner (waja) wrote :

Hi there,

any news about this?

Many thanks, Jan.

Revision history for this message
Roman Vynar (roman-vynar) wrote :

The project was moved to https://github.com/percona/percona-monitoring-plugins a long time ago.
For bug reporting and contribution please use GitHub.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.