Scripting problem - when the file is not found i want it to return to the menu

when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key

I know its probably something simple can anyone help?

here is my pause function:

function pause(){
read -s -n 1 -p "Press any key to return to Menu . . ."
echo
}

SCRIPT CODE

echo "Enter file name: "
read fname;

if [ -f $fname ]; then
echo "$fname found"
else
echo "$fname not found"
pause
fi
echo "Enter directory for file to be copied to: "
read dname;
if [ -d $dname ]; then
cp $fname $dname
echo "file copied"
sleep 5
else
echo "$dname not found"
sleep 5

fi;;

Use a while loop:

while :
do
   : print menu
   : get input here
   : use some condition to break out of the loop if input OK
done

Try this:

regards,
Arun.