title: while loop not working in shell
body: <p>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.</p>
  
  <pre><code>   #!/bin/ksh
     echo " enter file name "
     read $file
     if [ -f "$file" ] &amp;&amp; [ -s "$file" ]
      then 
     echo " file does not exist, or is empty "
        else
     while IFS='' read -r line || [[ -n "$file" ]];do
        echo "$line"
     done
     fi
  </code></pre>