join command in a loop
<p>I used join command to merge multiple files in my script.</p>

<pre><code>while read line; do  
    join file1 "$line" &gt; output  
    cat output &gt; file1  
done &lt; list
</code></pre>

<p>The thing is, as the loop progresses, more and more data are removed from the output file since not all entries matched across all data files. how can I preserve the unmatched data and be included in the output file?</p>