diff --git a/utils/audit b/utils/audit index 559818d5a..e71ad27ef 100755 --- a/utils/audit +++ b/utils/audit @@ -74,10 +74,17 @@ for my $profiling (@profiling) { chomp($fqdbin); } else { if ($profiling !~ /\//) { - my $which = which($profiling); - if ($which) { - $fqdbin = get_full_path($which); - } + opendir(DIR,$profiledir); + my @tmp_fqdbin = grep ( /$profiling/, readdir(DIR)); + closedir(DIR); + if (scalar @tmp_fqdbin eq 1) { + $fqdbin = "$profiledir/$tmp_fqdbin[0]"; + } else { + my $which = which($profiling); + if ($which) { + $fqdbin = get_full_path($which); + } + } } } diff --git a/utils/complain b/utils/complain index 7ee7f30de..830012259 100755 --- a/utils/complain +++ b/utils/complain @@ -74,10 +74,17 @@ for my $profiling (@profiling) { chomp($fqdbin); } else { if ($profiling !~ /\//) { - my $which = which($profiling); - if ($which) { - $fqdbin = get_full_path($which); - } + opendir(DIR,$profiledir); + my @tmp_fqdbin = grep ( /$profiling/, readdir(DIR)); + closedir(DIR); + if (scalar @tmp_fqdbin eq 1) { + $fqdbin = "$profiledir/$tmp_fqdbin[0]"; + } else { + my $which = which($profiling); + if ($which) { + $fqdbin = get_full_path($which); + } + } } } diff --git a/utils/enforce b/utils/enforce index d528647f0..cc132a7b2 100755 --- a/utils/enforce +++ b/utils/enforce @@ -74,10 +74,17 @@ for my $profiling (@profiling) { chomp($fqdbin); } else { if ($profiling !~ /\//) { - my $which = which($profiling); - if ($which) { - $fqdbin = get_full_path($which); - } + opendir(DIR,$profiledir); + my @tmp_fqdbin = grep ( /$profiling/, readdir(DIR)); + closedir(DIR); + if (scalar @tmp_fqdbin eq 1) { + $fqdbin = "$profiledir/$tmp_fqdbin[0]"; + } else { + my $which = which($profiling); + if ($which) { + $fqdbin = get_full_path($which); + } + } } }