Lets say I have an active/
directory that contains these files
active/
foo.bar.abc
foo.bar.xyz
foo.bat.abc
archive/
foo.bat.xyz
I want to write a command to output only unique filenames in active/
(uniqueness based on the middle item) AND doesn't match to any files already in archive/
(again based on that middle term).
Sample output:
foo.bar.abc
Explanation: output either foo.bar.abc
or foo.bar.xyz
doesn't matter. Not foo.bat.abc
since foo.bat.xyz
exists in archive/
I've found this to help identify unique values based on a pattern but I can't figure out how to combine that with my additional clause of no match in archive/