title: Shell script to read and write to a file
body: <p>I have a script which contains the file location and i am running a command to fix the files.
  But i am not able to write the output to a file.</p>
  
  <pre><code>#!/bin/ksh
  while read line
  do
  `shnfix "$line"` &gt;&gt; output.txt
  done &lt; filename.txt
  </code></pre>
  
  <p>The output generated after adding set -x in the beginning of the script.</p>
  
  <p><code>+ &lt; filename.txt
  + read line
  + shnfix /x01/naveen_wav/file1.wav
  + &gt;&gt; output.txt
  Fixing [/x01/naveen_wav/file1.wav] (3:49.42) --&gt; [file1-fixed.wav] : 100% OK
  Padded last file with 1194 zero-bytes.
  + read line
  + shnfix /x01/naveen_wav/file2.wav
  + &gt;&gt; output.txt
  Fixing [/x01/naveen_wav/file2.wav] (4:30.35) --&gt; [file2-fixed.wav] : 100% OK
  Padded last file with 644 zero-bytes.
  + read line
  </code></p>