I must find a non-trivial approach for a trivial printf "%s". In my case all keywords are a physical files in different locations. I would like to be able using a tab button to complete locations/files just as with CLI, and display all the files if they start with the same letters. Is it possible to add the index of the system to a bash script? Eg:
#!/bin/bash
printf "%s" "The file is: "
read keyword
~~~~~~~~~
./script.sh
The file is: /home/user/file
(Hit tab)
file.txt file2 file5
/home/user/file.
(Hit tab)
/home/user/file.txt
The files can be in different locations. Only 1 parameter will be provided at once.