Skip to content
Snippets Groups Projects
Commit 3d000595 authored by Justin Sieglaff's avatar Justin Sieglaff
Browse files

Script for comparing two copies of ancil

parent f86e73a2
No related merge requests found
#! /bin/bash
source ~/.bash_profile
golden_path=/data/common/GEOCAT_ANCILLARY_DATA/navigation/
subdir=$(basename $golden_path)
test_path=/data/justins/gancil/geocat-ancillary/data/${subdir}/
ls -1 $golden_path > $(pwd)/golden_list_${subdir}.txt
ls -1 $test_path > $(pwd)/test_list_${subdir}.txt
outfile=$(pwd)/${subdir}_comparison_report.txt
rm -f ${outfile}
while read line
do
grep -i $line $(pwd)/test_list_${subdir}.txt
if [ $? -ne 0 ]
then
echo "$line | exists in golden but not test" >> ${outfile}
fi
done<$(pwd)/golden_list_${subdir}.txt
echo "############################" >> $outfile
while read line
do
grep -i $line $(pwd)/golden_list_${subdir}.txt
if [ $? -ne 0 ]
then
echo "$line | exists in test but not golden" >> ${outfile}
fi
done<$(pwd)/test_list_${subdir}.txt
echo "############################" >> $outfile
while read line
do
grep -i $line $(pwd)/test_list_${subdir}.txt
if [ $? -eq 0 ]
then
diff ${golden_path}/$line ${test_path}/$line > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "${line} | files did not match." >> ${outfile}
fi
fi
done<$(pwd)/golden_list_${subdir}.txt
exit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment