title: bash script read line by line and echo to file
body: <p>I can't get this script to do what I want.  Can someone help it's supposed to read a text file line by line and then echo the result into another file. But it's not doing recognizing the blank line. As it supposed to print the line unless it's blank then it's suppose to print  to the file.</p>
  
  <pre><code>iname = checktest
  while read line           
  do  
  
  if [ "$line" == "" ];
  then
      echo "&lt;blank&gt;" &gt;&gt; $iname2.txt
  
  else    
    echo "$line"  &gt;&gt; $iname2.txt
  fi
  
  done &lt;$iname.txt
  </code></pre>