Some shell tools still use basename

Bug #912902 reported by Baron Schwartz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Low
Brian Fraser

Bug Description

All of the shell tools do something like this:

if [ "$(basename "$0")" = "..." ]

It turns out that sometimes basename can be "-bash", so that looks like

$ basename -bash

And "basename" doesn't take a -bash option.

The fix is to do this:

if [ "$(basename -- "$0")" = "..." ]

Tags: shell-tools

Related branches

Changed in percona-toolkit:
status: New → Confirmed
tags: added: shell-tools
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Confirmed → In Progress
summary: - basename not guaranteed to work for Shell tools
+ Some shell tools still use basename
Changed in percona-toolkit:
importance: Undecided → Low
status: In Progress → Fix Committed
assignee: nobody → Brian Fraser (fraserbn)
milestone: none → 2.1.2
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-765

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.