use egrep when necessary. part of issue #30