A logical problem.

I'm having a logical problem.Can anybody help me.

while [[ ! -e $ZipFile ]]
do
  echo " Enter the Zip File Name   : \c"
  read ZipFile
done

In the above snippet - I want it ask for file name first time and once validation fails, I want it add a msg that its entered file name doesn't exist and ten prompt for file name again.

Could be silly.- But it just that I not able get a logic for it.

Instead you could change the existing message to

while [[ ! -f $ZipFile ]]
do
  echo "Enter a valid Zip File Name   : \c"
  read ZipFile
done

Thatz what I did as work around :). But just curious ,there must be way out.

Hence posted my problem.

Thanks anyways. !

while [ 1 ]
do
    echo "Enter File name : \c"
    read file

    if [[ -f $file ]] ; then
        break;
    else
        echo "File does not exist"
    fi;
done