Can anyone help me with the below. I do not understand what is wrong, Not getting any output. My requirement is to read a file and check if it's not empty and to print the content line by line.
#!/bin/ksh
echo " enter file name "
read $file
if [ -f "$file" ] && [ -s "$file" ]
then
echo " file does not exist, or is empty "
else
while IFS='' read -r line || [[ -n "$file" ]];do
echo "$line"
done
fi