select choises in ${list_files[@]}; do
if CONTAINS_ELEMENT $choises "${list_files[@]}" || CONTAINS_ELEMENT $REPLY "${list_files[@]}"; then
break
else
echo "invalid choise (PS use the ID numbers)! Try again:"
fi
done
This makes both the ID number and the full directory name work, the code is a bit ugly though, and there is no name completion.