i am trying to check if a file exists before continuing with my script but it is not working.
if [ -e $filename ]
then
file_menu #calls the function file_menu if file exists
else
echo data file does not exist
fi
i have put in dummy file names but it always calls the function. it seems to ignore that file does not exist.
can anyone help?
i am using korn shell.
Start Free Trial