Take the 2-minute tour ×

Inside my Bash script i'm reading some variables entered by the user with READ:

read -p "Glassfish Path:" GF_DIR

Now i want that the user gets a autocompletion when he has to enter a directory, like when you are on the Bash shell. So when he enters the first letters of a directory, he can autocomplete it by hitting TAB. Is that possible?

share|improve this question
add comment

1 Answer

up vote 10 down vote accepted


read -e -p "Glassfish Path:" GF_DIR

-e enables readline:

    to obtain the line.
share|improve this answer
Sorry, should have read the manpage. Thought it's not that easy ;) –  ifischer Jan 27 '11 at 18:12
add comment

Your Answer


