title: How to compare two files in shell script?
body: <p>Here is my scenario.
  I have two files which are having records with each record's 3-25 characters is an identifier. Based on this I need to compare both of them and update the old file with the new file data if their identifiers match. Identifiers start with 01.
  Please look at the script below.
  This is giving some error as "argument expected at line 12 which I am not able to understand.</p>
  
  <pre><code>#!/bin/ksh
  while read line
    do
      c=`echo $line|grep '^01' `
      if [ $c -ne NULL ];
        then
          var=`echo $line|cut -c 3-25`
      fi
      while read i
        do
          d=`echo $i|grep '^01' `
          if [ $d -ne NULL ];
            then
              var1=`echo $i|cut -c 3-25`
              if [ $var -eq $var1 ];
                then
                  $line=$i
              fi
          fi
        done &lt; test_monday
    done &lt; test_sunday
  </code></pre>
  
  <p>Please help me out thanks in advance</p>