Bash Autocomplete script that uses otherh auto completions

Hey guys I have been searching and reading about bash completions scripts and I cant seem to find exactly what I need.

The autocomplete behaviour I am looking for is similar to the time command in ubuntu.

eg. If I type time dock[tab] it completes time docker because I have docker installed. The autocomplete will carry on for the already-completed command. eg. If I type time docker exec -ti [tab] it will suggest all the docker container names as if the time command was not in front of the docker command.

Is there some way I can replicate this behaviour for my own script?

myScript.sh docker exec -ti [tab]

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like