From 4a44794d076659cb244d67e2d1781da864585948 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 14 Aug 2012 10:39:50 -0600 Subject: [PATCH] Use sh instead of bash for pt-mysql-summary. Set +u around Bashism check. --- bin/pt-mysql-summary | 7 ++++--- bin/pt-summary | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 3759e31a..9557fc03 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # This program is part of Percona Toolkit: http://www.percona.com/software/ # See "COPYRIGHT, LICENSE, AND WARRANTY" at the end of this file for legal @@ -608,7 +608,7 @@ shorten() { } group_concat () { - sed -e '{H; $!d;}' -e 'x' -e 's/\n[[:space:]]*\([[:digit:]]*\)[[:space:]]*/, \1x/g' -e 's/[[:space:]][[:space:]]*/ /g' -e 's/, //' "${1}" + sed -e 'H; $!d;' -e 'x' -e 's/\n[[:space:]]*\([[:digit:]]*\)[[:space:]]*/, \1x/g' -e 's/[[:space:]][[:space:]]*/ /g' -e 's/, //' "${1}" } # ########################################################################### @@ -2308,9 +2308,10 @@ main() { # Execute the program if it was not included from another file. # This makes it possible to include without executing, and thus test. +set +u if [ "${0##*/}" = "$TOOL" ] \ || [ "${0##*/}" = "bash" -a "$_" = "$0" ]; then - +set -u # Set up temporary dir. mk_tmpdir # Parse command line options. diff --git a/bin/pt-summary b/bin/pt-summary index 68662a0c..37dbdccd 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -2180,9 +2180,10 @@ sigtrap() { local PTFUNCNAME=sigtrap; # Execute the program if it was not included from another file. This makes it # possible to include without executing, and thus test. +set +u if [ "${0##*/}" = "$TOOL" ] \ || [ "${0##*/}" = "bash" -a "$_" = "$0" ]; then - +set -u # Set up temporary dir. mk_tmpdir # Parse command line options.