What if one string is contained in the other but should not be counted?
How about
grep /$string1.*$string2|$string2.*$string1/,
In reply to Re^3: grep for lines containg two variables
by ikegami
in thread grep for lines containg two variables
by smoss74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |