Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:37:21+00:00 2026-06-12T17:37:21+00:00

Is have a keyword in bash? Or do bash completion scripts use a language

  • 0

Is have a keyword in bash? Or do bash completion scripts use a language that is not bash?

have gcc &&
_gcc()
{

It is common. See: grep "have .* &&" /etc/bash_completion.d/*

I could not find any information on the bash completion tutorials I’ve seen and I could not find any information in man bash. It’s also difficult to google “have”. Where do I find documentation on this?

I’m guessing it has to do with making sure that there gcc exists in the PATH?

edit: yes. /etc/bash_completion contains:

have()
{
    unset -v have
    # Completions for system administrator commands are installed as well in
    # case completion is attempted via `sudo command ...'.
    PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null &&
    have="yes"
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:37:22+00:00Added an answer on June 12, 2026 at 5:37 pm

    have and _have are just two functions defined in the base bash_completion file. Between the two, they form a wrapper around the built-in type command to determine if a particular command/program available.

    # This function checks whether we have a given program on the system.
    #
    _have()
    {
        # Completions for system administrator commands are installed as well in
        # case completion is attempted via `sudo command ...'.
        PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
    }
    
    # Backwards compatibility for compat completions that use have().
    # @deprecated should no longer be used; generally not needed with dynamically
    #             loaded completions, and _have is suitable for runtime use.
    have()
    {
        unset -v have
        _have $1 && have=yes
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an existing code in bash that greps a keyword from a
I have a small bash script that greps/awk paragraph by using a keyword. But
I have created a keyword search in SQL that takes a list of keywords
I have a function that accepts wildcard keyword parameters: def func(**kargs): doA doB How
I find Vim's keyword completion very useful when I only have files of the
I have a keyword field of type Array that is generated on the creation
It seems that VB.NET and C# readonly keyword have some differences... Say, a ReadOnly
I would like to find all the sites, that have the keyword 'surfing waves'
I have a keyword implemented with Java and if keyword fails i need to
I have the following relatonships Keyword(1)<--->(n)K2I(n)<--->(1)Clip(n)<--->(1)Media Namely, We have a set a keywords and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.