use variables for grep and egrep to enable Solaris 11 acceptance tests

Solaris 11 doesn't understand the grep options used in the test script. It doesn't have the posix xpg tools. Use GREP and EGREP variables and on Solaris 11, use the gnu tools.