Last active
August 29, 2015 14:07
-
-
Save fabien7337/cee23c6a7682b2e07515 to your computer and use it in GitHub Desktop.
Useful to compare a file line by line: for example to extract lines that are in file1 but not in file2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
while read line_file1 | |
do | |
answered=$(cat file2| grep $line_file1) | |
if [ -z "$answered" ]; then | |
echo $line_file1 | |
fi | |
done < file1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment