Don't use tab completion. Use globs. /b*
will match /bat
, /boo
and /bury
if these files or directories exist.
#!/bin/bash
shopt -s nullglob
IFS= read -p "Enter a full or partial name: " -r filename
for f in "$filename"*
do
echo "Possible match: $f"
done