Hi,
echo "Enter file name of input file list along with absolute path : "
read inputFileList
if [ -f $inputFileList ]
then
for string in `cat inputFileList`
do
echo $string
done
else
echo " file does not exist"
fi
From the above code, if the user enters a invalid file then "file does not exist" is given and the program is done.
How to prompt the user for input continuously untill the user enters the proper file name with absolute path without exiting the program i.e. "Enter file name of input file list along with absolute path : " prompt should be given as long as the user gives a invalid filename.
Using a loop is one way. any other way or better ways?
Thanks,
Srini