On 4/6/21 2:40 AM, Bernhard Voelker wrote:
grep -Fvf file2 file1
I started with that, too, but it is problematic because:
a) it doesn't do a whole-word search ... and 'grep -w' seems not to be portable,
b) it doesn't limit the matching on the key field.
And messing with regular expressions seems to be fragile as well, because the
key field may contain problematic characters.
Yes, 'awk' is the way to go if you want more 'join' capability (not just
treating the entire line as the key). But if the data are not large and
each key takes up the whole line, 'grep' should work fine.
Regular expressions are not a problem, as the -F option disables them.