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 6475507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:42:45+00:00 2026-05-25T06:42:45+00:00

I have a script which allows to execute Bash processes in the background, i

  • 0

I have a script which allows to execute Bash processes in the background, i called it “backy”. Programs I want to run in background I call like this:

backy long-running-script param1 param2

The problem is now that I loose the Bash completion for long-running-script if I prepend another script.

I want to write a Bash completion file which preserves not only the Bash completion for long-running-script and all of its parameters, also for every other script that I want to call with backy.

I have some experience with Bash completion, but I’m just missing the command which I can insert into my Bash completion script so that it completes with the completion of the script that is to be called. Any ideas?

My completion so far:

have backy &&
_backy_complete()
{
  local cur prev goals

  COMPREPLY=()
  cur=${COMP_WORDS[COMP_CWORD]}

  # How to get the completion from the script that is the param for backy, 
  # in a generic way?
  COMPREPLY=( ????? )
  return 0
} &&
complete -F _backy_complete backy

EDIT – SOLUTION:

Thanks to Lekensteyn, I replaced the content of my existing bash completion script with just this line:

complete -F _command backy
  • 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-05-25T06:42:46+00:00Added an answer on May 25, 2026 at 6:42 am

    There is already a bash_completion function for such cases:

    complete -F _command backy
    

    It’s used for autocompleting the commands after sudo, fakeroot and others. Any arguments passed to backy are ignored like:

    backy --whatever --this --is=ignored not ignored anymore
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a script which allows me to output the list of files
I have a script which will be run interactively by non-technical users. The script
I have a script which creates a user-defined object like this: obj = new
I have a script which, each time is called, gets the first line of
I have a .bat that sets up an environment which allows users to execute
I have a script which allows to retrieve Google suggestions (XML) with Javascript and
I have a Perl script which will allow for a file to be uploaded
I have a script which contacts a few sources and tell them the IP-address
I have a script which logs on to a remote server and tries to
I have this script which basically toggles a bgColor class on and off so

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.