- section() revamp

- Redirect STDERR for the collection part in both tools
- rm_tempdir in sigtrap
- A part of pt-mysql-summary still depended on the system being run,
  rather than the samples being read. Now it works properly.
This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-04-02 19:25:17 -03:00
parent 6dbbd6de3b
commit c0dedd19bf
13 changed files with 159 additions and 95 deletions

View File

@@ -64,7 +64,12 @@ fuzzy_pct () {
# with #'s and all underscores with spaces.
section () {
local str="$1"
local line="$(printf '#_%-60s' "${str}_" | sed -e 's/[[:space:]]/#/g' -e 's/_/ /g')"
local line="$(printf '# %-60s' "${str} _" | awk '{
i = index($0, "_");
x = substr($0, i);
gsub(/[_ \t]/, "#", x);
printf("%s%s\n", substr($0, 0, i-1), x);
}')"
printf "%s\n" "${line}"
}