How to combine two grep statements and display their results together?

What you really want is "OR", not "AND". If "AND" is used, then logically, you'll get no lines (unless the line is something like "MyVariable = False...MyVariable = True".

Use "extended grep" and the OR operator (|).

grep -E 'MyVariable = False|MyVariable = True' FormA.frm

You should use

grep "MyVariable = \(False\|True\)" FormA.frm

where the \| sequence mean an alternative, and the delimiters \( and \) are for grouping.

Tags:

Grep