Monday, November 09, 2009

How to use the OR operator in grep instead of the Windows pipe symbol

Doesn't work:
egrep firstTerm|secondTerm file.txt

egrep: (standard input): Not enough space
'SW1' is not recognized as an internal or external command,
operable program or batch file.

Works: (caret '^' escape symbol)
egrep firstTerm^|secondTerm file.txt

No comments: