Skip to content

Instantly share code, notes, and snippets.

@andrewp-as-is
Last active July 20, 2019 15:08
Show Gist options
  • Save andrewp-as-is/8e4b04e28d3855dce29ad7e048ff0586 to your computer and use it in GitHub Desktop.
Save andrewp-as-is/8e4b04e28d3855dce29ad7e048ff0586 to your computer and use it in GitHub Desktop.
substract lines
#!/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"
li
li ne1
li ne2
li
li ne1
li ne3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment