The use of multiple -e options has always been something of an undocumented feature anyway. To use only standard, documented, portable facilities, you might want to egrep 'FAILURE|ERROR' or some rough equivalent of { echo FAILURE; echo ERROR } | fgrep -f - (and actually I guess the latter won't work on some crude platforms either; specifying standard input with a dash as the argument to the -f option isn't really portable, either, IIRC).