- or download this
$ cat A; echo '* * * * *'; cat B
apple
...
lime
orange
banana
- or download this
$ perl -e 'open F,$ARGV[0] or die;shift;my %set = map {$_ => 1 } <>; f
+or (<F>) {print if $set{$_}};' A B
lime
- or download this
$ perl -e 'open F,$ARGV[0] or die;shift;my %set = map {$_ => 1 } <>; f
+or (<F>) {print unless $set{$_}};' A B
apple
cherry
carrot
- or download this
$ cat C
grape
...
$ perl -e 'open F,$ARGV[0] or die;shift;my %set = map {$_ => 1 } <>; f
+or (<F>) {print if $set{$_}};' A B C
cherry
lime