Bug 862841 - Shell function "have()" is not defined and causes errors in bash completion scripts
Shell function "have()" is not defined and causes errors in bash completion s...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: bash-completion (Show other bugs)
17
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-03 14:10 EDT by Christian
Modified: 2012-10-03 14:46 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-03 14:46:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christian 2012-10-03 14:10:07 EDT
Description of problem:

/etc/bash_completion.d/grub seems to assume the function have() is available, but that's not the case.

Version-Release number of selected component (if applicable):

I've been seeing this problem for several releases now, starting around F15 and still happening in F17

How reproducible:

Always.

Steps to Reproduce:
1. Start a bash shell.
  
Actual results:

Shell reports errors:

bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found

Expected results:

Bash should shut up. :)

Additional info:

I'm working around this via a conditional definition of have() in my own Bash scripts, but I feel I must be missing something. Is anyone else seeing this?
Comment 1 Ville Skyttä 2012-10-03 14:28:13 EDT
$ rpm -qf /etc/bash_completion.d/grub
grub2-tools-2.0-0.38.beta6.fc17.x86_64

So that file comes from grub2, not bash-completion.

Anyway, how are you loading /etc/bash_completion.d/grub? You shouldn't be loading anything from /etc/bash_completion.d "manually" in your startup files, bash-completion does it itself automatically when appropriate and when it does, the have() function is defined.
Comment 2 Christian 2012-10-03 14:46:48 EDT
Ah, I see -- I assumed the completion package maintains those files. I should have checked first.

I've dug deeper and I found that the problem is that my user's bash setup scripts prevent bash_completion.sh from being sourced, so the function isn't available.

Thanks!

Note You need to log in before you can comment on or make changes to this bug.