diff options
Diffstat (limited to 'scripts/mytop.sh')
-rw-r--r-- | scripts/mytop.sh | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/scripts/mytop.sh b/scripts/mytop.sh index fe7765988fb..17a87e9efd2 100644 --- a/scripts/mytop.sh +++ b/scripts/mytop.sh @@ -70,7 +70,6 @@ sub GetShowStatus(); sub cmd_s; sub cmd_S; sub cmd_q; -sub FindProg($); ## Default Config Values @@ -1366,9 +1365,9 @@ sub GetInnoDBStatus() { if (not $config{pager}) { - if (not $config{pager} = FindProg('less')) + if (not $config{pager} = my_which('less')) { - $config{pager} = FindProg('more'); + $config{pager} = my_which('more'); } } @@ -1467,9 +1466,9 @@ sub GetShowVariables() { if (not $config{pager}) { - if (not $config{pager} = FindProg('less')) + if (not $config{pager} = my_which('less')) { - $config{pager} = FindProg('more'); + $config{pager} = my_which('more'); } } @@ -1825,25 +1824,6 @@ sub Execute($) return $sth; } -sub FindProg($) -{ - my $prog = shift; - my $found = undef; - my @search_dirs = ("/bin", "/usr/bin", "/usr/sbin", - "/usr/local/bin", "/usr/local/sbin"); - - for (@search_dirs) - { - my $loc = "$_/$prog"; - if (-e $loc) - { - $found = $loc; - last; - } - } - return $found; -} - #### #### my_which is used, because we can't assume that every system has the #### which -command. my_which can take only one argument at a time. |