Bash - find something in one file and if it doesn't exist in the second file print.
I'm trying to compare two files. I want to grab the first line in the first file and check second file to see if it exists. If it does not exist in second file then print. And so on for every line in file1.
Right now i don't get any output stuck into my output file. I'm sure this is easy and i've just stared at it too long.
while read $line
grep $line $file2 > /dev/null
if [ $? -ne 0 ]; then
echo $line >> output.txt
done < $file1