loop para o local do arquivo até que o arquivo exista no bash

Eu criei esta função:

function promptFile()

{

while true;
    do
            read -p "Please provide a full path [q to quit]: " file
            if [ $file == q ]; then
                    echo "Exiting.."
                    return 1
            fi

            if [ ! -f $file ]; then
                    echo "File does not exist, please try again"

            else
                    echo $file
                    break
            fi
    done
}

Para solicitar a localização do arquivo, pergunte novamente se o arquivo não existe e salve a saída em uma variável, caso exista, a função é chamada:

tempLoc=$(promptFile)
if [ !tempLoc ]; then
        fileLocation=$tempLoc
fi

Tudo funciona bem, a menos que alguém escreva um local de arquivo incorreto, então o eco não é mostrado até alguém clicar em q ou inserir um local de arquivo existente. nesse caso, a mensagem de eco será impressa * o número de entradas incorretas, conforme a seguir.

[root@tsting:0]# ./tst
Please provide a full path [q to quit]: tst1
Please provide a full path [q to quit]: tst2
Please provide a full path [q to quit]: tst3
Please provide a full path [q to quit]: tst4
Please provide a full path [q to quit]: q
File does not exist File does not exist File does not exist File does not exist Exiting..
[root@tsting:0]#

Suponho que isso aconteça porque o loop volta a imprimir todos os ecos, pois existe uma maneira de evitar isso e basta imprimir o eco quando o local do arquivo incorreto é inserido?

questionAnswers(2)

yourAnswerToTheQuestion