Last active
July 20, 2019 15:08
-
-
Save andrewp-as-is/8e4b04e28d3855dce29ad7e048ff0586 to your computer and use it in GitHub Desktop.
substract lines
This file contains 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
#!/usr/bin/env bash | |
f1="file1.txt" | |
f2="file2.txt" | |
echo "f2 only:" | |
awk 'FNR==NR{array[$0];next}{if ($0 in array) next;print $0}' "$f1" "$f2" |
This file contains 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
li | |
li ne1 | |
li ne2 |
This file contains 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
li | |
li ne1 | |
li ne3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment