updated commenting

This commit is contained in:
Chris Garland 2017-10-10 12:06:28 +08:00
parent ca0d4af058
commit aabe661dbe

View File

@ -3,7 +3,7 @@ temp_file="temp.sort"
num_insertions=0 num_insertions=0
num_duplicates=0 num_duplicates=0
# Copy contents of second file into first file # Append contents of new_file into main_file
# ensuring no duplicates. # ensuring no duplicates.
while read p; do while read p; do
if [ $(grep -w $p $2 | wc -l) -eq 0 ]; then 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 INSERTIONS: $num_insertions"
echo "NUMBER OF DUPLICATES: $num_duplicates" echo "NUMBER OF DUPLICATES: $num_duplicates"
# Sort main_file
sort $2 > $temp_file sort $2 > $temp_file
cat $temp_file > $2 cat $temp_file > $2
rm -f $temp_file rm -f $temp_file