sh warnings in pt-summary and pt-mysql-summary

Bug #1035260 reported by Giovanni Bechis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Daniel Nichter

Bug Description

To work properly bash is still needed in pt-summary and pt-mysql-summary; patches to fix the problem added.

Related branches

Revision history for this message
Giovanni Bechis (g-bechis) wrote :
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Thanks for the patch Giovanni.

tags: added: pt-mysql-summary pt-summary
Changed in percona-toolkit:
status: New → Triaged
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Brian, we need to see if one of our test servers has a real /bin/sh. If so, we can test this and double-check the code for other Bash-isms.

Changed in percona-toolkit:
importance: Undecided → Medium
milestone: none → 2.1.4
Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Giovanni, this patch makes pt-summary work on on OpenBSD for you? I can't get it to work on OpenBSD 5:

$ ./pt-summary
./pt-summary[2200]: @: parameter not set

Or,

$ ./pt-summary --help
Usage:

For more information, 'man pt-summary' or 'perldoc ./pt-summary'.
...

./pt-summary[2200]: ${!varname}": bad substitution

However, it seems that changing "$@" to "${@:-""}" makes it work (except for that last ^ bad substitution error).

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

"${@:-""}" does seem to make pt-summary work.

Giovanni, could you please download pt-summary from http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/sh-not-bash-bug-1035260/view/head:/bin/pt-summary and confirm that it works on your system too?

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

That "bad substitution" is fixed in r360 of that branch.

Changed in percona-toolkit:
status: Triaged → In Progress
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

r360 pt-mysql-summary runs on my OpenBSD without errors.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Older related bug 872175

tags: added: bsd crash shell-tools
removed: pt-mysql-summary pt-summary
Changed in percona-toolkit:
status: In Progress → Fix Committed
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-562

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.