85

I want to learn how to write bash completion scripts. Which tutorial would you recommend?

closed as off-topic by terdon Apr 7 '16 at 8:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – terdon
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What do you mean by "bash completion tutorial"? Please explain. – Patkos Csaba Dec 10 '10 at 21:14
  • 2
    @Tshepang: I guess you mean you want to learn how to write bash completion routines? Using bash completion is pretty easy, you just hit the tab key. – intuited Dec 11 '10 at 4:45
  • 10
    You may want to check out the link I provide in my answer here: unix.stackexchange.com/questions/1800/custom-autocomplete – Steven D Dec 11 '10 at 5:45
  • 2
    @Tshepang People don't generally delete comments, particularly ones that are still valid like Steven's. Keep in mind that the answers here aren't just for you -- they're for everyone who googles "bash completion tutorial" in the future – Michael Mrozek Dec 13 '10 at 15:28
  • 8
    How come this question is considered "too broad" ? That's ridiculous. It's perfectly valid, and answers provided prove it's not so easy to find out. – Cyan Mar 19 '15 at 0:02
56

There aren't that many bash completion tutorials around, but this one is pretty good:

Introduction to Bash Completion

  • Part 1 is for general knowledge
  • Part 2 covers creating scripts in /etc/bash_completion.d/
  • This looks good on DuckDuckGo, albeit lesser than on Google. Gets my vote if there's an Oscars for StackExchange :-) – jalanb Aug 23 '18 at 5:46
20
+50

I would start by looking at the library of bash completions already put together by the folks here:

http://bash-completion.alioth.debian.org/

They also have a mailing list:

http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Not the answer you're looking for? Browse other questions tagged or ask your own question.