0

I want to enter location of file in bash, like this :

while [[ ! -f "$location" ]]; do
   read -p "Enter application location : " location
done

Can I use TAB to autofill location like enter path in terminal. Can it done? How to do it?

Son Tran Thai
  • 251
  • 2
  • 7

1 Answers1

0

Simply use -e switch:

while [[ ! -f "$location" ]]; do
   read -ep "Enter application location >>> " location
done
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223