1

I would like to create a bash script foo.sh.

When it runs, it will prompt for a directory. The user will be able to use tab to auto complete?

Here is some example code assuming read has some option.

echo -n "Enter the directory of awesomeness: "
read --enable-autocomplete DIR_OF_AWESOMENESS
echo "The Dir of Awesomeness is $DIR_OF_AWESOMENESS"

Thanks!

1 Answer 1

3

Bash auto-completion works on command-line arguments. Here is a two-part introduction for writing auto-completion with examples.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .