Skip to main content
added 42 characters in body
Source Link
OJFord
  • 2.1k
  • 2
  • 19
  • 36

If, like me, you actually wanted "both; each exactly once","both; each exactly once", (this is actually "either; twice") then it's simple:

grep -E "thing1|thing2" -c 

and check for the output 2.

The benefit of this approach (if exactly once is what you want) is that it scales easily.

If, like me, you actually wanted "both; each exactly once", then it's simple:

grep -E "thing1|thing2" -c 

and check for the output 2.

The benefit of this approach (if exactly once is what you want) is that it scales easily.

If, like me, you actually wanted "both; each exactly once", (this is actually "either; twice") then it's simple:

grep -E "thing1|thing2" -c 

and check for the output 2.

The benefit of this approach (if exactly once is what you want) is that it scales easily.

Source Link
OJFord
  • 2.1k
  • 2
  • 19
  • 36

If, like me, you actually wanted "both; each exactly once", then it's simple:

grep -E "thing1|thing2" -c 

and check for the output 2.

The benefit of this approach (if exactly once is what you want) is that it scales easily.