I am really sorry I was just checking the octal value for \n.
Okay any how the program should be like this
echo "Enter answer"
read answer
if [ "$answer" = "" ]
then
echo "You must enter a file name"
exit 1
else
cat $answer
fi
Well from your mail I think your concern is that you want to check whether the particular file exists or not, Am i right. If so then
use the below code after *read answer* in the above code
Code:
if [ ! -s $answer ]
then
echo "The file does not exist"
exit 1
fi
Regards
JK
added code tags for readability --oombera