#@1 = list of old nodes
#@2 = new list of nodes (file name)

newlist=$2
oldlist=$1

exec 3<&0
exec 0<$newlist

count=0;
filecount=30;
prefix="sitelist";
suffix=".txt";
temp=$(printf "%d" ${filecount});
filename=${prefix}${temp};

while read line
do
  echo ${temp};
  grep $line $oldlist > /dev/null
  retval=$?;
  if [ $retval == 1 ];then
      (( count += 1 ));
      echo $line;
      echo $filename;
      echo $line >> ${filename}
      
      if [ "$count" -ge 20 ];then
	  count=0;
	  (( filecount += 1 ));
	  temp=$(printf "%d" ${filecount});
	  filename=${prefix}${temp};
      fi
  fi
done
