title: Bash script that checks between 2 csv files old and new. To check that in the new file, the line count has content which is x % of the old files?
body: <p>As of now how i am writing the script is to count the number of lines for the 2 files.</p>
  
  <p>Then i put it though condition if it is greater than the old.</p>
  
  <p>However, i am not sure how to compare it based on percentage of the old files. </p>
  
  <p>I there a better way to design the script.</p>
  
  <pre><code>#!/bin/bash
  
  declare -i new=$(&lt; "$(ls -t file name*.csv | head -n 1)" wc -l)
  declare -i old=$(&lt; "$(ls -t file name*.csv | head -n 2)" wc -l)
  
  echo $new
  echo $old
  
  if [ $new -gt $old ];
  then
  echo "okay";
  else
  echo "fail";
  </code></pre>