disposable-email-domains/alpha_insert.sh

17 lines
270 B
Bash
Raw Normal View History

#!/bin/bash
temp_file="temp.sort";
# Copy contents of second file into first file
# ensuring no duplicates.
while read p; do
if [ $(grep -w $p $2 | wc -l) -eq 0 ]; then
echo $p >> $2
fi
done < $1
sort $2 > $temp_file
cat $temp_file > $2
rm -f $temp_file
#end