diff --git a/alpha_insert.sh b/alpha_insert.sh index 2169e5a..ed9be3a 100755 --- a/alpha_insert.sh +++ b/alpha_insert.sh @@ -3,7 +3,7 @@ temp_file="temp.sort" num_insertions=0 num_duplicates=0 -# Copy contents of second file into first file +# Append contents of new_file into main_file # ensuring no duplicates. while read p; do if [ $(grep -w $p $2 | wc -l) -eq 0 ]; then @@ -17,6 +17,7 @@ done < $1 echo "NUMBER OF INSERTIONS: $num_insertions" echo "NUMBER OF DUPLICATES: $num_duplicates" +# Sort main_file sort $2 > $temp_file cat $temp_file > $2 rm -f $temp_file