title: Bash script processing too slow
body: <p>I have the following script where I'm parsing 2 csv files to find a MATCH the files have 10000 lines each one. But the processing is taking a long time!!! Is this normal?</p>
  
  <p>My script:</p>
  
  <pre><code>#!/bin/bash 
  
  IFS=$'\n'
  
  CSV_FILE1=$1;
  CSV_FILE2=$2;
  
  sort -t';' $CSV_FILE1 &gt;&gt; Sorted_CSV1
  sort -t';' $CSV_FILE2 &gt;&gt; Sorted_CSV2
  
  echo "PATH1 ; NAME1 ; SIZE1 ; CKSUM1 ; PATH2 ; NAME2 ; SIZE2 ; CKSUM2"  &gt;&gt; 'mapping.csv'
  
  
  while read lineCSV1 #Parse 1st CSV file
  do
  
         PATH1=`echo $lineCSV1 | awk '{print $1}'`
         NAME1=`echo $lineCSV1 | awk '{print $3}'`
         SIZE1=`echo $lineCSV1 | awk '{print $7}'`
         CKSUM1=`echo $lineCSV1 | awk '{print $9}'`      
  
      while read lineCSV2   #Parse 2nd CSV file
      do
         PATH2=`echo $lineCSV2 | awk '{print $1}'`
         NAME2=`echo $lineCSV2 | awk '{print $3}'`
         SIZE2=`echo $lineCSV2 | awk '{print $7}'`
         CKSUM2=`echo $lineCSV2 | awk '{print $9}'`
  
         # Test if NAM1 MATCHS NAME2
  
          if [[ $NAME1 == $NAME2 ]]; then
  
              #Test checksum OF THE MATCHING NAME
  
                  if [[ $CKSUM1 != $CKSUM2 ]]; then                   
  
              #MAPPING OF THE MATCHING LINES  
                  echo $PATH1 ';' $NAME1 ';' $SIZE1 ';' $CKSUM1 ';' $PATH2 ';' $NAME2 ';' $SIZE2 ';' $CKSUM2 &gt;&gt; 'mapping.csv'
                  fi
          break #When its a match break the while loop and go the the next Row of the 1st CSV File
          fi       
      done &lt; Sorted_CSV2 #Done CSV2
  
  
  done &lt; Sorted_CSV1 #Done CSV1
  </code></pre>