Use sh instead of bash for pt-mysql-summary. Set +u around Bashism check.

This commit is contained in:
Daniel Nichter
2012-08-14 10:39:50 -06:00
parent 366ec95188
commit 4a44794d07
2 changed files with 6 additions and 4 deletions

View File

@@ -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.

View File

@@ -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.